I have a web site that you can send a post just like fb I want to know how could I handle the post time for each local time? I was thinking about changing timezone.now to utc and save it. But when I want show it to user how convert it too user's local time? And what is professional's solution? Thanks
Asked
Active
Viewed 217 times
1
-
possible duplicate of [How do I get the visitor's current timezone then convert timezone.now() to string of the local time in Django 1.4?](http://stackoverflow.com/questions/10157720/how-do-i-get-the-visitors-current-timezone-then-convert-timezone-now-to-strin) – AdamKG Aug 11 '13 at 17:10
1 Answers
1
Django supports working with time zones out of the box (documentation). Setting USE_TZ=True
enables time zone support: django will store timezone-aware datetimes in the database; when it comes to template rendering - it'll show datetimes for the user's time zone.

alecxe
- 462,703
- 120
- 1,088
- 1,195