I'm only experienced with the Oracle backend, but I believe only Postgres stores datetimes with timezone information. Otherwise, Django assumes all datetimes in the database are UTC. For the most portability you should assume that database values will be in UTC.
The user's local timezone is something you have to set, either in middleware or somewhere in the request processing.
I think there's no packages TimezoneMiddleware because how you do it is highly up to your app UI. Maybe you want to use GeoIP? Maybe you want to store it in the user's profile? Maybe you want a dropdown on each page? All of those are valid options.
On Tue, May 17, 2016 at 3:51 PM, Noumia Ngangoum <stunaz@gmail.com> wrote:
--
Hi, how really work timezoned application?
Let's stay I set my app to be used worldwide, which means I have user in america, in africa, in europe...
Whatever operations they do within the database, all dates will be saved with timezone, right?
But how do you identify the timezone of a user? is that something that I should ask the user for and save it, and then use it whenever is necessary?
Why a TimeZoneMiddleWare is not available?
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6690c2f5-a921-4713-aa04-62a372a123f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAD4ANxVtx0qctHD%2B6UNJkaAzpbR1Q%2BKiCjF8pWhfODs%3DhrhyBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment