How to know what time is it in user's region django?

Viewed 23

I have django web app with authentication. I want to see on users profile when he joined(created account).

I have created model field like:

joined_at = models.DateTimeField(auto_now_add=True, blank=True)

but it gives me utc time. Which is 2 hours behind our time. And if someone from China would be able to create an account he would have bad experience with that too. So I want to find out what time it is in user's region and display that on field.

Thanks for help:)

1 Answers

you can use: django-tz-detect 0.4.0

docs

Related