[patch] Experimental time zone support for date and time fields, database backend utilities
|Reported by:||bahamut@…||Owned by:||nobody|
|Severity:||normal||Keywords:||timezone, time zone, UTC|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
The attached patch attempts to improve Django's support for time zones.
Specifically, it modifies the date and time fields so that they return str(self.data), which will yield an ISO 8601 formatted date, but with a space separator instead of a T. That format will include a time zone offset using the [+-]HH:MM format if the underlying datetime object is not naive. That format is understood by most databases.
It also modifies the function typecast_timestamp from db.backend.util such that it will try to parse time zone offsets. If no such format is found, it will still produce a non-naive datetime object, set in the current time zone.
Change History (5)
Changed 10 years ago by bahamut@…
comment:3 Changed 9 years ago by SmileyChris
- Patch needs improvement set
- Triage Stage changed from Unreviewed to Design decision needed