1 from time import localtime, time
11 elif ((t - nt) < 7*86400) and (nt < t):
13 date = (_("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat"), _("Sun"))[d[6]]
16 date = "%d.%d." % (d[2], d[1])
18 date = "%d.%d.%d" % (d[2], d[1], d[0])
20 timeres = "%d:%02d" % (d[3], d[4])
22 return (date, timeres)
24 if __name__ == "__main__":
25 print "now: %s %s" % FuzzyTime(time())
26 print "1 day: %s %s" % FuzzyTime(time() + 86400)
27 print "2 days: %s %s" % FuzzyTime(time() + 86400 *2)
28 print "2 days: %s %s" % FuzzyTime(time() + 86400 *3)
29 print "2 days: %s %s" % FuzzyTime(time() + 86400 *4)
30 print "2 days: %s %s" % FuzzyTime(time() + 86400 *5)
31 print "2 days: %s %s" % FuzzyTime(time() + 86400 *6)
32 print "2 days: %s %s" % FuzzyTime(time() + 86400 *7)
33 print "2 days: %s %s" % FuzzyTime(time() + 86400 *8)
34 print "2 days: %s %s" % FuzzyTime(time() + 86400 *9)
35 print "2 days: %s %s" % FuzzyTime(time() + 86400 *10)
36 print "2 days: %s %s" % FuzzyTime(time() + 86400 *11)
37 print "2 days: %s %s" % FuzzyTime(time() + 86400 *12)
38 print "2 days: %s %s" % FuzzyTime(time() + 86400 *13)
39 print "2 days: %s %s" % FuzzyTime(time() + 86400 *14)