diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-09-08 02:04:31 -0500 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-09-09 22:32:51 +0200 |
| commit | ec2778b445546f624d3b3a1f2118e751b10bb2e7 (patch) | |
| tree | 1ea949e943904505974c48e1219d5593528664c1 /docs | |
| parent | 9d700322b38ea670800a97f2b92dd2fc2c6ff28d (diff) | |
Fixed #17262 -- Refactored tzinfo implementations.
This commit deprecates django.utils.tzinfo in favor of the more recent
django.utils.timezone which was introduced when Django gained support
for time zones.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 2 | ||||
| -rw-r--r-- | docs/ref/utils.txt | 20 | ||||
| -rw-r--r-- | docs/releases/1.7.txt | 19 |
3 files changed, 41 insertions, 0 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 307f4dec64..054e3b32fc 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -417,6 +417,8 @@ these changes. * ``django.utils.importlib`` will be removed. +* ``django.utils.tzinfo`` will be removed. + * ``django.utils.unittest`` will be removed. * The ``syncdb`` command will be removed. diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index a093de18b7..59a501cf82 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -927,6 +927,17 @@ For a complete discussion on the usage of the following see the :class:`~datetime.tzinfo` instance that represents UTC. +.. function:: get_fixed_timezone(offset) + + .. versionadded:: 1.7 + + Returns a :class:`~datetime.tzinfo` instance that represents a time zone + with a fixed offset from UTC. + + ``offset`` is a :class:`datetime.timedelta` or an integer number of + minutes. Use positive values for time zones east of UTC and negative + values for west of UTC. + .. function:: get_default_timezone() Returns a :class:`~datetime.tzinfo` instance that represents the @@ -1021,6 +1032,9 @@ For a complete discussion on the usage of the following see the ``django.utils.tzinfo`` ======================= +.. deprecated:: 1.7 + Use :mod:`~django.utils.timezone` instead. + .. module:: django.utils.tzinfo :synopsis: Implementation of ``tzinfo`` classes for use with ``datetime.datetime``. @@ -1028,6 +1042,12 @@ For a complete discussion on the usage of the following see the Fixed offset in minutes east from UTC. + .. deprecated:: 1.7 + Use :func:`~django.utils.timezone.get_fixed_timezone` instead. + .. class:: LocalTimezone Proxy timezone information from time module. + + .. deprecated:: 1.7 + Use :func:`~django.utils.timezone.get_default_timezone` instead. diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index fdba5a80a5..c49ad86c6c 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -308,6 +308,16 @@ For apps with migrations, ``allow_migrate`` will now get passed without custom attributes, methods or managers. Make sure your ``allow_migrate`` methods are only referring to fields or other items in ``model._meta``. +pytz may be required +~~~~~~~~~~~~~~~~~~~~ + +If your project handles datetimes before 1970 or after 2037 and Django raises +a :exc:`~exceptions.ValueError` when encountering them, you will have to +install pytz_. You may be affected by this problem if you use Django's time +zone-related date formats or :mod:`django.contrib.syndication`. + +.. _pytz: https://pypi.python.org/pypi/pytz/ + Miscellaneous ~~~~~~~~~~~~~ @@ -389,6 +399,15 @@ Features deprecated in 1.7 respectively :mod:`logging.config` and :mod:`importlib` provided for Python versions prior to 2.7. They have been deprecated. +``django.utils.tzinfo`` +~~~~~~~~~~~~~~~~~~~~~~~ + +``django.utils.tzinfo`` provided two :class:`~datetime.tzinfo` subclasses, +``LocalTimezone`` and ``FixedOffset``. They've been deprecated in favor of +more correct alternatives provided by :mod:`django.utils.timezone`, +:func:`django.utils.timezone.get_default_timezone` and +:func:`django.utils.timezone.get_fixed_timezone`. + ``django.utils.unittest`` ~~~~~~~~~~~~~~~~~~~~~~~~~ |
