Localized timezone support (Review Board)
Review Request #2725 — Created Dec. 1, 2011 and submitted — Latest diff uploaded
Adds per-user timezone support, relying on the USE_TZ feature from the Django dev branch. Using this method, datetime's are stored in the database in UTC and are timezone-aware. Datetime objects are stored with tzinfo=utc, so that they can be easily converted into any other timezone when retrieved from the database. Middleware was created in the accounts app which activates the user's timezone in each session. A timezone field is added to the user model to store their local time, which they can change in "My account". The user profile and admin forms use TimeZoneField, which is pre-populated with all the available timezone choices. Templates which show dates and/or times are changed to display the user's local time with the {% load tz %}{% localtime on %} tags.