mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
20 lines
354 B
Python
20 lines
354 B
Python
import time
|
|
|
|
x = time.gmtime(1000)
|
|
|
|
assert x.tm_year == 1970
|
|
assert x.tm_min == 16
|
|
assert x.tm_sec == 40
|
|
assert x.tm_isdst == 0
|
|
|
|
s = time.strftime("%Y-%m-%d-%H-%M-%S", x)
|
|
# print(s)
|
|
assert s == "1970-01-01-00-16-40"
|
|
|
|
x2 = time.strptime(s, "%Y-%m-%d-%H-%M-%S")
|
|
assert x2.tm_min == 16
|
|
|
|
s = time.asctime(x)
|
|
# print(s)
|
|
assert s == "Thu Jan 1 00:16:40 1970"
|