summaryrefslogtreecommitdiff
path: root/django/utils/timezone.py
AgeCommit message (Collapse)Author
2025-02-18Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.Mariusz Felisiak
datetime.UTC was added in Python 3.11.
2023-01-18Fixed #34233 -- Dropped support for Python 3.8 and 3.9.Mariusz Felisiak
2023-01-17Refs #32365 -- Removed django.utils.timezone.utc per deprecation timeline.Mariusz Felisiak
2023-01-17Refs #32365 -- Removed is_dst argument for various methods and functions.Mariusz Felisiak
Per deprecation timeline.
2023-01-17Refs #32365 -- Removed support for pytz timezones per deprecation timeline.Mariusz Felisiak
2022-10-31Used more augmented assignment statements.Nick Pope
Identified using the following command: $ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]'
2022-04-20Fixed #33654 -- Added localdate to utils.timezone.__all__. Andrey Otto
2022-03-29Refs #32365 -- Deprecated django.utils.timezone.utc.Carlton Gibson
2022-03-24Refs #32365 -- Removed internal uses of utils.timezone.utc alias.Carlton Gibson
Remaining test case ensures that uses of the alias are mapped canonically by the migration writer.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-09-27Refs #32355 -- Used @functools.lru_cache as a straight decorator.Mariusz Felisiak
2021-09-16Fixed #32365 -- Made zoneinfo the default timezone implementation.Carlton Gibson
Thanks to Adam Johnson, Aymeric Augustin, David Smith, Mariusz Felisiak, Nick Pope, and Paul Ganssle for reviews.
2021-08-30Fixed #32992 -- Restored offset extraction for fixed offset timezones.Carlton Gibson
Regression in 10d126198434810529e0220b0c6896ed64ca0e88.
2021-05-12Fixed #32366 -- Updated datetime module usage to recommended approach.Nick Pope
- Replaced datetime.utcnow() with datetime.now(). - Replaced datetime.utcfromtimestamp() with datetime.fromtimestamp(). - Replaced datetime.utctimetuple() with datetime.timetuple(). - Replaced calendar.timegm() and datetime.utctimetuple() with datetime.timestamp().
2021-01-19Refs #32365 -- Allowed use of non-pytz timezone implementations.Paul Ganssle
2019-09-10Refs #29546 -- Removed django.utils.timezone.FixedOffset per deprecation ↵Mariusz Felisiak
timeline.
2019-06-20Fixed #30451 -- Added ASGI handler and coroutine-safety.Andrew Godwin
This adds an ASGI handler, asgi.py file for the default project layout, a few async utilities and adds async-safety to many parts of Django.
2018-09-26Refs #29784 -- Switched to https:// links where available.Jon Dufresne
2018-07-09Fixed #29546 -- Deprecated django.utils.timezone.FixedOffset.Sergey Fedoseev
2018-06-28Fixed #29514 -- Reverted "Used datetime.timezone.utc instead of pytz.utc for ↵Tim Graham
better performance." This reverts commit 27ca5ce19f5f184018a61611c1bc319113b1d107 due to a regression.
2018-03-20Used datetime.timezone.utc instead of pytz.utc for better performance.Sergey Fedoseev
2018-03-03Refs #17476 -- Removed obsolete simplification of timezone names in cache ↵Sergey Fedoseev
key generation.
2017-10-24Fixed #28739 -- Fixed get_fixed_timezone() for negative timedeltas.medmunds
2017-06-20Fixed #28323 -- Removed unneeded normalize() in timezone.localtime() and ↵Tim Graham
make_naive().
2017-02-11Refs #27656 -- Updated django.utils docstring verbs according to PEP 257.Anton Samarchyan
2017-01-19Refs #23919 -- Removed usage of django.utils.decorators.ContextDecorator.Chillar Anand
2017-01-18Refs #23919 -- Stopped using django.utils.lru_cache().Aymeric Augustin
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2016-11-14Fixed E305 flake8 warnings.Ramin Farajpour Cami
2016-11-07Fixed #27138 -- Restored pre-Python 3.6 behavior of localtime() and ↵Joachim Jablon
make_naive() on Python 3.6. Reverted test changes in a7a7ecd2b026c61a39a46d2d7eced0e06a92c970 and e43ea36b7681e43ea99505a2cf7550d4d36016b3 (refs #27025).
2016-10-27Fixed #27327 -- Simplified time zone handling by requiring pytz.Tim Graham
2016-08-31Fixed #25181 -- Added localdate() function to get date in a different time zone.Jon Dufresne
Thanks Konrad Świat for the original patch.
2016-04-04Fixed W503 flake8 warnings.Tim Graham
2015-12-03Fixed #25761 -- Added __cause__.__traceback__ to reraised exceptions.Raphaël Hertzog
When Django reraises an exception, it sets the __cause__ attribute even in Python 2, mimicking Python's 3 behavior for "raise Foo from Bar". However, Python 3 also ensures that all exceptions have a __traceback__ attribute and thus the "traceback2" Python 2 module (backport of Python 3's "traceback" module) relies on the fact that whenever you have a __cause__ attribute, the recorded exception also has a __traceback__ attribute. This is breaking testtools which is using traceback2 (see https://github.com/testing-cabal/testtools/issues/162). This commit fixes this inconsistency by ensuring that Django sets the __traceback__ attribute on any exception stored in a __cause__ attribute of a reraised exception.
2015-05-02Simplified the implementation of timezone.is_aware/naive.Aymeric Augustin
2015-04-24Fixed #22598 -- Allowed make_aware() to work with ambiguous datetimeJosh Smeaton
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2014-11-19Simplified caching of get_default_timezone().Aymeric Augustin
2014-10-20Fixed #23668 -- Changed make_aware() and make_naive() to use the current ↵Jon Dufresne
timezone by default Thanks Aymeric Augustin for review.
2014-08-31Fixed #23388 -- Made django.utils.timezone.override usable as a decoratorThomas Chaumeny
2014-08-28Fixed #23381 -- Context manager restored state should be determined in __enter__Thomas Chaumeny
2014-05-17Fixed several flake8 errors, including one where a test wouldn't be runAlex Gaynor
2014-05-16Optimized make_aware/naive by removing redundant checks. Refs #22625.Aymeric Augustin
Also added tests with pytz and removed misplaced tests.
2014-05-16Fixed #22625 -- Normalized make_aware/naive errors.Aymeric Augustin
Also added tests for is/make_aware/naive. Thanks Tom Michaelis for the report.
2014-01-26Fixed #21880 -- Added missing items to django.utils.timezone.__all__.Aymeric Augustin
Thanks Wim for the report.
2013-11-02Correct flake8 E302 violationsRay Ashman Jr
2013-10-21Fixed #21288 -- Fixed E126 pep8 warningsAlasdair Nicol
2013-09-09Fixed #17262 -- Refactored tzinfo implementations.Aymeric Augustin
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.
2013-09-08Fixed #18766 -- Pointed to pytz when LocalTimezone fails.Aymeric Augustin
Thanks void for the report.
2013-02-11Accepted None in tzname().Aymeric Augustin
This is required by the tzinfo API, see Python's docs. Also made _get_timezone_name deterministic.