正确的时间在Djang

2024-04-26 00:37:21 发布

您现在位置:Python中文网/ 问答频道 /正文

设置.py我使用:

TIME_ZONE = 'Europe/Moscow'
USE_I18N = True
USE_L10N = True
USE_TZ = True

打开页面.html

{% now "jS F Y H:i" %}

我看到2014年12月25日22:40,现在是21:40。模型字段中的auto_now_add=True也有同样的问题-我的时间错了(hour+1)。你知道吗

怎么解决?你知道吗

谢谢!你知道吗


Tags: py模型truezonetimeusehtmljs