cpython/Lib/dos-8x3/test_tim.py

40 lines
928 B
Python
Raw Normal View History

import time
time.altzone
time.clock()
t = time.time()
time.asctime(time.gmtime(t))
if time.ctime(t) <> time.asctime(time.localtime(t)):
print 'time.ctime(t) <> time.asctime(time.localtime(t))'
time.daylight
1997-12-09 12:56:41 -04:00
if long(time.mktime(time.localtime(t))) <> long(t):
print 'time.mktime(time.localtime(t)) <> t'
time.sleep(1.2)
tt = time.gmtime(t)
1997-04-02 02:13:34 -04:00
for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I',
1998-03-26 18:14:20 -04:00
'j', 'm', 'M', 'p', 'S',
'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'):
1997-10-06 17:19:59 -03:00
format = ' %' + directive
try:
1998-03-26 18:14:20 -04:00
time.strftime(format, tt)
1997-10-06 17:19:59 -03:00
except ValueError:
1998-03-26 18:14:20 -04:00
print 'conversion specifier:', format, ' failed.'
time.timezone
time.tzname
# expected errors
try:
time.asctime(0)
except TypeError:
pass
try:
time.mktime((999999, 999999, 999999, 999999,
1998-03-26 18:14:20 -04:00
999999, 999999, 999999, 999999,
999999))
except OverflowError:
pass