今天发布项目后才发现log时间和win10系统时间或者date不一致。
查了好多。
最后:是django项目中settings中时区的问题
在settings中默认为UTC时区,我们应转换为中国时区
即做一下修改:
LANGUAGE_CODE = 'zh-Hans'
TIME_ZONE = 'Asia/Shanghai'
即可ok
参考自https://blog.csdn.net/chenKFKevin/article/details/72888182
今天发布项目后才发现log时间和win10系统时间或者date不一致。
查了好多。
最后:是django项目中settings中时区的问题
在settings中默认为UTC时区,我们应转换为中国时区
即做一下修改:
LANGUAGE_CODE = 'zh-Hans'
TIME_ZONE = 'Asia/Shanghai'
即可ok
参考自https://blog.csdn.net/chenKFKevin/article/details/72888182