From 4c047b90e5fa6e0e2b14384b2c0016cfa4463716 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Thu, 16 Jul 2020 15:46:23 -0400 Subject: [PATCH] Manual steps of port to Python 3. --- src/allmydata/util/time_format.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/allmydata/util/time_format.py b/src/allmydata/util/time_format.py index eb3434c47..27b2e0976 100644 --- a/src/allmydata/util/time_format.py +++ b/src/allmydata/util/time_format.py @@ -1,5 +1,9 @@ -# ISO-8601: -# http://www.cl.cam.ac.uk/~mgk25/iso-time.html +""" +Time formatting utilities. + +ISO-8601: +http://www.cl.cam.ac.uk/~mgk25/iso-time.html +""" import calendar, datetime, re, time @@ -74,11 +78,11 @@ def format_delta(time_1, time_2): delta = int(time_2 - time_1) seconds = delta % 60 delta -= seconds - minutes = (delta / 60) % 60 + minutes = (delta // 60) % 60 delta -= minutes * 60 - hours = delta / (60*60) % 24 + hours = delta // (60*60) % 24 delta -= hours * 24 - days = delta / (24*60*60) + days = delta // (24*60*60) if not days: if not hours: if not minutes: