python3时间处理

#!/noah/bin/python3 -u


import time


second = str(time.time()).split('.')[0]


print(time.localtime(time.time()))

time.sleep(1)

newSecond = str(time.time()).split('.')[0]

t1 = int(second)
t2 = int(newSecond)
print(t2-t1)

print(second)
print(newSecond)

你可能感兴趣的:(python3时间处理)