这里我们会看见数据保存到数据库中后,入库时间变成了2014-10-31 16:00:00,这是因为settings.py时区设置为:TIME_ZONE = 'America/Chicago'的缘故,把USE_TZ = True修改为即可USE_TZ = False:
# If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = False
Copyright @ 2024 yjanb11 Powered by .NET 8.0 on Kubernetes Powered by: .Text and ASP.NET Theme by: .NET Monster