X-Git-Url: https://git.rkrishnan.org/?p=tahoe-lafs%2Ftahoe-lafs.git;a=blobdiff_plain;f=src%2Fallmydata%2Futil%2Ftime_format.py;fp=src%2Fallmydata%2Futil%2Ftime_format.py;h=c481adc37fe734ed6f1896732ee57d71e3b2e049;hp=a6fe3ec72c45ba21e4220bf1eea5d7680e48a29b;hb=c86388b79c34ba0e71bee01e5c739db2ae6e3403;hpb=a2d724aab7bf6dd2f7ffde37cb21c570ba773bf8 diff --git a/src/allmydata/util/time_format.py b/src/allmydata/util/time_format.py index a6fe3ec7..c481adc3 100644 --- a/src/allmydata/util/time_format.py +++ b/src/allmydata/util/time_format.py @@ -66,27 +66,3 @@ def parse_date(s): # day return int(iso_utc_time_to_seconds(s + "T00:00:00")) -def format_delta(time_1, time_2): - if time_1 is None: - return "N/A" - if time_1 > time_2: - return '-' - delta = int(time_2 - time_1) - seconds = delta % 60 - delta -= seconds - minutes = (delta / 60) % 60 - delta -= minutes * 60 - hours = delta / (60*60) % 24 - delta -= hours * 24 - days = delta / (24*60*60) - if not days: - if not hours: - if not minutes: - return "%ss" % (seconds) - else: - return "%sm %ss" % (minutes, seconds) - else: - return "%sh %sm %ss" % (hours, minutes, seconds) - else: - return "%sd %sh %sm %ss" % (days, hours, minutes, seconds) -