Database returned an invalid datetime value. Are time zone definitions for your database installed?

出现时区问题

 

解决方案:

修改settings.py的时区变量。

修改前:

LANGUAGE_CODE = ‘en-us’

TIME_ZONE = ‘UTC’

USE_I18N =True

USE_L10N =True

USE_TZ = True

 

修改后:

LANGUAGE_CODE =‘zh-hans’

TIME_ZONE =‘Asia/Shanghai’

USE_I18N =True

USE_L10N =True

USE_TZ =False

 

————————————————
版权声明:本文为CSDN博主「_冷山_」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_40905896/article/details/108504198

posted @ 2021-06-03 10:44  Jerry`  阅读(238)  评论(0编辑  收藏  举报