t.strftime('%m月%d %H:%M')<class 'datetime.datetime'>
Traceback (most recent call last):
File "D:/pythonworks/xinkongxinxi1/comment_dao.py", line 28, in <module>
tstr = t.strftime('%m月%d %H:%M')
UnicodeEncodeError: 'locale' codec can't encode character '\u6708' in position 2: encoding error
#格式化时间不能有中文,如果想要中文需要设置 import locale locale.setlocale(locale.LC_CTYPE,'chinese')
0条评论
我要评论