python设置时区
这里我们会看见数据保存到数据库中后,入库时间变成了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
python设置时区这里我们会看见数据保存到数据库中后,入库时间变成了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
|