Setting Django admin display times to local time?

前端 未结 4 2244
天命终不由人
天命终不由人 2021-02-14 14:16

When I see dates and times in the admin, they are displayed in UTC. I\'d like for them to be displayed in my local timezone. I checked the TIME_ZONE setting in the

4条回答
  •  遇见更好的自我
    2021-02-14 14:32

    This isn't supported natively in Django as of 2.1. However https://github.com/charettes/django-sundial may provide what you need -- this adds a User.timezone model field so that you can configure it per-user.

    (This middleware is very simple -- under the covers it's just calling timezone.activate(zone) to change the rendered site's timezone).

提交回复
热议问题