added year as an allowable time unit for display
authorForrest Voight <forrest@forre.st>
Sun, 7 Jul 2013 07:26:27 +0000 (03:26 -0400)
committerForrest Voight <forrest@forre.st>
Sun, 7 Jul 2013 07:26:27 +0000 (03:26 -0400)
p2pool/util/math.py

index c45d1ec..04ed3ff 100644 (file)
@@ -82,7 +82,7 @@ def format(x):
     return '%i' % (x,) + s
 
 def format_dt(dt):
-    for value, name in [(60*60*24, 'days'), (60*60, 'hours'), (60, 'minutes'), (1, 'seconds')]:
+    for value, name in [(365.2425*60*60*24, 'years'), (60*60*24, 'days'), (60*60, 'hours'), (60, 'minutes'), (1, 'seconds')]:
         if dt > value:
             break
     return '%.01f %s' % (dt/value, name)