Show More
@@ -14,15 +14,13 b' def stringify(thing):' | |||||
14 | return "".join([stringify(t) for t in thing if t is not None]) |
|
14 | return "".join([stringify(t) for t in thing if t is not None]) | |
15 | return str(thing) |
|
15 | return str(thing) | |
16 |
|
16 | |||
17 |
agescales = [(" |
|
17 | agescales = [("year", 3600 * 24 * 365), | |
18 |
("m |
|
18 | ("month", 3600 * 24 * 30), | |
19 | ("hour", 3600), |
|
|||
20 | ("day", 3600 * 24), |
|
|||
21 | ("week", 3600 * 24 * 7), |
|
19 | ("week", 3600 * 24 * 7), | |
22 |
(" |
|
20 | ("day", 3600 * 24), | |
23 |
(" |
|
21 | ("hour", 3600), | |
24 |
|
22 | ("minute", 60), | ||
25 | agescales.reverse() |
|
23 | ("second", 1),] | |
26 |
|
24 | |||
27 | def age(date): |
|
25 | def age(date): | |
28 | '''turn a (timestamp, tzoff) tuple into an age string.''' |
|
26 | '''turn a (timestamp, tzoff) tuple into an age string.''' |
General Comments 0
You need to be logged in to leave comments.
Login now