django 1.4 how to automatically get user's timezone from client

前端 未结 5 955
误落风尘
误落风尘 2020-12-01 21:17

I would like to know if there is a way to automatically retrieve user\'s timezone from client. Especially during login.

I tried to add this in the login page (using

5条回答
  •  自闭症患者
    2020-12-01 21:36

    I was hunting around for the sam thing yesterday. In the end I ended up putting together a Django app to what BluesRockAddict suggests above (i.e. use getTimezoneOffset):

    https://github.com/adamcharnock/django-tz-detect

    I hope someone finds that useful.

提交回复
热议问题