D
D
Domohod2022-02-16 08:25:33
Django
Domohod, 2022-02-16 08:25:33

How to determine Django user's timezone?

I need to display the time for each user on the site, depending on his time zone. How to do it? UTC - of course it's good, but not so convenient.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2022-02-16
@bacon

And Django can't do that. But you can on the client side, with the help of js, find out this and report it to the server.
UPD: it's better to recalculate it on the client, i.e. the server responds with UTC, and on the client through js, it already leads to the desired one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question