diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-04-12 14:46:24 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-05-17 09:36:23 +0200 |
| commit | ec186572e6cfde4cd4bc1491ff552c5d32211d9f (patch) | |
| tree | 84bfb6b786f7dfecc535347a14284032bf0a5370 /docs | |
| parent | eda12ceef16aa1a98567e25be619b05a5b3c5757 (diff) | |
Removed global timezone-aware datetime converters.
Refs #23820.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/1.9.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index c2ceb5f5db..28c953b212 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -313,6 +313,12 @@ Database backend API doesn't implement this. You may want to review the implementation on the backends that Django includes for reference (:ticket:`24245`). +* The recommended way to add time zone information to datetimes fetched from + databases that don't support time zones is to register a converter for + ``DateTimeField``. Do this in ``DatabaseOperations.get_db_converters()``. + Registering a global converter at the level of the DB-API module is + discouraged because it can conflict with other libraries. + Default settings that were tuples are now lists ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -412,6 +418,21 @@ console, for example. If you are overriding Django's default logging, you should check to see how your configuration merges with the new defaults. +Removal of time zone aware global converters for datetimes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Django no longer registers global converters for returning time zone aware +datetimes in database query results when :setting:`USE_TZ` is ``True``. +Instead the ORM adds suitable time zone information. + +As a consequence, SQL queries executed outside of the ORM, for instance with +``cursor.execute(query, params)``, now return naive datetimes instead of aware +datetimes on databases that do not support time zones: SQLite, MySQL, and +Oracle. Since these datetimes are in UTC, you can make them aware as follows:: + + from django.utils import timezone + value = value.replace(tzinfo=timezone.utc) + Miscellaneous ~~~~~~~~~~~~~ |
