Barry Warsaw | b0c2232 | 1996-12-06 23:30:07 +0000 | [diff] [blame] | 1 | import time |
| 2 | |
| 3 | time.altzone |
| 4 | time.clock() |
| 5 | t = time.time() |
| 6 | time.asctime(time.gmtime(t)) |
| 7 | if time.ctime(t) <> time.asctime(time.localtime(t)): |
| 8 | print 'time.ctime(t) <> time.asctime(time.localtime(t))' |
| 9 | |
| 10 | time.daylight |
| 11 | if int(time.mktime(time.localtime(t))) <> int(t): |
| 12 | print 'time.mktime(time.localtime(t)) <> t' |
| 13 | |
| 14 | time.sleep(1.2) |
| 15 | tt = time.gmtime(t) |
Guido van Rossum | ad183bb | 1997-02-20 16:23:01 +0000 | [diff] [blame] | 16 | for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', |
| 17 | 'j', 'm', 'M', 'p', 'S', |
Barry Warsaw | b0c2232 | 1996-12-06 23:30:07 +0000 | [diff] [blame] | 18 | 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): |
| 19 | format = '%' + directive |
| 20 | time.strftime(format, tt) |
| 21 | |
| 22 | time.timezone |
| 23 | time.tzname |
| 24 | |
| 25 | # expected errors |
| 26 | try: |
| 27 | time.asctime(0) |
| 28 | except TypeError: |
| 29 | pass |
| 30 | |
| 31 | try: |
| 32 | time.mktime((999999, 999999, 999999, 999999, |
| 33 | 999999, 999999, 999999, 999999, |
| 34 | 999999)) |
| 35 | except OverflowError: |
| 36 | pass |