解决python time.strftime(“%X“)打印时区乱码的问题
解决print(time.strftime("%X"))打印中国时区乱码的问题一.解决方法在 print(time.strftime("%X")) 之前插入import ctypes, localelocale.setlocale(locale.LC_ALL, '')ctypes.cdll.ucrtbase._tzset()二.例子在这里我需要打印出现在的时区,代码如下:# 解决中国·时区乱码问题import timeimport ctypes, localeprint(local
原创
2020-12-01 23:13:33 ·
1366 阅读 ·
1 评论