| 155 | |
| 156 | === Multiple timezone support for datetime representation === |
| 157 | * '''Complexity''': Medium |
| 158 | |
| 159 | Currently The `TIME_ZONE` Django setting allows PostgreSQL-backed installations to run project/application on timezones different from each other and from the system timezone of the server. |
| 160 | Also, the information of !DateTime fields is retrieved from the database as naïve Python `datetime` instances and when the DB backend is PostgreSQL the data sent and retrieved to/from the DB is corrected by the `TIME_ZONE` value. |
| 161 | |
| 162 | But if you need to have: |
| 163 | |
| 164 | * date+time data to be entered in different locations using the local time |
| 165 | * such data be displayed in the local time at different locations different from the location where it was originally entered. |
| 166 | |
| 167 | then more granularity is needed so different instances of date+time inside one application can be handled in a way that takes in account its timezone. |
| 168 | |
| 169 | An additional possibility would to create an additional presentation layer, where an user location/timezone preference can influence and personalize the display of date+time's (see the Django template filter idea in one of the thread linked below.) |
| 170 | |
| 171 | Other advantages of a solution to this problem could be: Isolation from daylight saving time political policy changes and isolation from changes on time zones should the hosting of a production application be moved form one geographical location to another. |
| 172 | |
| 173 | Issues to consider: |
| 174 | * Compatibility with all the DB backend officially supported by Django |
| 175 | * Backwards compatibility: Existing installations shouldn't be affected at all regarding the storage/interpretation of `DateTime` model fields values |
| 176 | |
| 177 | See also: |
| 178 | * Tickets #2626, #10587 and possibly #1480 and #2447 |
| 179 | * A django-dev [http://groups.google.com/group/django-developers/browse_thread/thread/b8c885389374c040 thread] |
| 180 | * Another django-dev [http://groups.google.com/group/django-developers/browse_thread/thread/4ca560ef33c88bf3 thread] |
| 181 | * A [http://mad.ly/2008/04/09/rails-21-time-zone-support-an-overview/ blog post] describing how this was implemented for ''Ruby on Rails'' 2.1 |
| 182 | * [http://www.postgresql.org/docs/8.4/static/datatype-datetime.html timestamp] PostgreSQL data type documentation |
| 183 | * Django `TIME_ZONE` setting documentation as of 1.2: http://docs.djangoproject.com/en/dev/ref/settings/#time-zone |