Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django从1.9版本就支持在settings.py文件中配置TIME_ZONE了,不需要手动+8了 #3077

Open
dean2021 opened this issue Aug 5, 2019 · 3 comments

Comments

@dean2021
Copy link

commented Aug 5, 2019

Django从1.9版本就支持在settings.py文件中配置TIME_ZONE了,不需要手动+8了,
管理大大改一下吧

@dean2021

This comment has been minimized.

Copy link
Author

commented Aug 5, 2019

我说的是数据库配置哪里的时区

@ibuler

This comment has been minimized.

Copy link
Member

commented Aug 8, 2019

貌似没有哪里设置数据库的时区吧

@dean2021

This comment has been minimized.

Copy link
Author

commented Aug 9, 2019

貌似没有哪里设置数据库的时区吧

link : https://docs.djangoproject.com/en/1.9/ref/settings/#time-zone,

e.g:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'mydatabase',
        'USER': 'mydatabaseuser',
        'PASSWORD': 'mypassword',
        'HOST': '127.0.0.1',
        'PORT': '5432',
       'TIME_ZONE':'Asia/Shanghai',
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.