python打印中文时间

import time
import os

# 格式化成2016-03-20 11:45:39形式
print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))

list = os.listdir("C:\\Users\\Administrator\\")
print(list)

for i in list:
    print (time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(os.path.getatime(i))))

2019-01-15 11:30:52
2019-02-09 09:55:24
2019-02-09 09:55:24
2018-12-04 13:44:24
2019-01-15 11:30:52
2018-12-04 13:44:27
2019-02-11 01:56:09
2019-01-15 11:30:52
2019-02-05 21:56:06

你可能感兴趣的:(代码,python)