NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #15 most downloaded on PyPI
Extensions to the standard Python datetime module
Latest stable
4.0.0
Last release 21 days ago
01 Nov 2026
Release timing varies
gaps range from 1 weeks to 2.6 years
Nearly every release is documented
notes for 33 of 36 stable releases
Nothing withdrawn
no release was ever pulled
18 years old
36 releases · first in 2008
Drag across the ruler to compare, or tap a release to open it.
dateutil 4.0 requires Python 3.11 or later and no longer depends on six . Apart from that, the changes in this release are bug fixes, but note that is
dateutil 4.0 requires Python 3.11 or later and no longer depends on six. Apart from that, the changes in this release are bug fixes, but note that isoparse is now stricter about the numeric fields it accepts (see below).
six, along with Python 2 compatibility helpers that were never part of the public API, such as dateutil.tz.tzname_in_python2. (gh pr #1625)parser.isoparse, and the isoparser methods parse_isodate, parse_isotime and parse_tzstr, now require each numeric field to be exactly the expected number of ASCII digits. Strings that were previously accepted, such as 20200728121240 (read as 21:24), 2014- 4-21 and 2_14-04-21, and offsets such as +-1:00, now raise ValueError. tzical applies the same check to TZOFFSETFROM and TZOFFSETTO. Reported by @janos-gonye (gh issue #1074). Fixed by @varun3257 (gh pr #1617).rrule or rruleset could hang forever if another iterator over the same rule had already completed the cache, for example when a cached rrule was included twice in an rruleset. Reported by @bysiber (gh pr #1455). Fixed by @pganssle (gh pr #1655).tzutc now gives the dateutil.tz.UTC singleton, and unpickling a tzoffset gives the same object as calling tzoffset(name, offset). Previously unpickling bypassed the singleton-generation logic. Reported and fixed by @masipcat (gh issue #1051, gh pr #1053).relativedelta(yearday=366) now resolves to December 31 in leap years. Previously it gave December 30, the same date as yearday=365. Reported and fixed by @Master-Norna (gh pr #1583).pyproject.toml. Versions are still derived from Git tags and exposed as dateutil.__version__. This mainly affects people building dateutil from source. (gh pr #1637, #1638)Your coding agent can read these notes before it upgrades. Set up the MCP server →
Deprecated the dateutil.zoneinfo module. The module now acts as a wrapper around the tzdata package and will be removed in a future version. Users are…
This is the last major version of dateutil that will support any version of Python older than 3.11. The next release will be the 4.x series, which will support Python 3.11 and later. We may release fixes for serious bugs in the 3.0.x series, but there are no plans for new features there.
The biggest change in this release is a rewrite of tz.tzfile, which affects nearly every user of dateutil.tz and changes the UTC offset of nonexistent times (see below). dateutil also now depends on the tzdata package, and no longer ships its own time zone database.
dateutil no longer bundles a copy of the IANA time zone database. Time zone data now comes from the system (see dateutil.tz.TZPATH) or, failing that, from the new tzdata dependency, so the data version is whatever version of tzdata is installed. (gh pr #1130)tz.tzfile based on a backport of the zoneinfo module's pure-Python implementation. This adds support for Version 2 and Version 3 tzfile(5) binaries, resolving issues with timestamps beyond 2038 and "slim" format binaries. (gh issues #462, #1059, gh pr #1130)dateutil.tz.TZPATH and dateutil.tz.reset_tzpath to allow for runtime configuration of the IANA time zone data search path. These replace the mutable dateutil.tz.TZPATHS list, which has been removed. (gh pr #1130)dateutil now depends on the tzdata package, which gettz consults after the search path and before the Windows registry. On Windows this means that names that are both IANA keys and Windows time zone names, such as "UTC", now return a tzfile rather than a tzwin. (gh pr #1130)tz.tzfile now follows PEP 495 for times that fall in a gap: with fold=0 it uses the offset from before the transition, and with fold=1 the offset from after it. Previously it always used the offset from after the transition, so for example datetime(2003, 4, 6, 2, 30, tzinfo=tz.gettz("America/New_York")) had a UTC offset of -04:00, where it now has -05:00, the same as with zoneinfo. (gh pr #1130)tz.tzfile objects for fixed-offset zones, such as tz.gettz("UTC"), now return their offset, DST offset and abbreviation when utcoffset, dst and tzname are called with None, as tz.tzutc, tz.tzoffset and zoneinfo.ZoneInfo do. This means that datetime.time objects with such a zone attached are now aware: time(12, tzinfo=tz.gettz("UTC")).isoformat() is now "12:00:00+00:00" rather than "12:00:00". (gh pr #1130)tz.tzfile now infers dst() from the standard time on both sides of each DST period, rather than only the one before it, and does so for each transition rather than for each local time type. This fixes dst() for double summer time (e.g. in Europe/London in the 1940s), for half-hour DST (e.g. in Pacific/Rarotonga) and where the standard offset changed at the same time as a DST transition (e.g. in America/Bahia_Banderas in 2010). Against the standard offsets in the tz database source, the only remaining errors are in Europe/Paris in 1944 and 1945. (gh pr #1130)rrulestr raising ValueError on experimental X- parameters in an RRULE line (such as GNOME Evolution's X-EVOLUTION-ENDDATE); these are now ignored as RFC 5545 permits. Fixed by @yajo (gh pr #1374)rrule and rruleset instances. The cache setting is preserved, and cached results are regenerated on demand without copying locks or generators. Reported by @niccokunzmann (gh issue #1369). Fixed by @Jay1023CN (gh pr #1600).relativedelta.__ne__ raising TypeError when comparing against an unsupported type such as None; it now returns True. Reported and fixed by @kevinkt1 (gh issue #1157, gh pr #1158)six to 1.6, fixing No module named 'six.moves' errors with older versions. Reported by @skytreader (gh issue #1415), fixed by @jdarias3 (gh pr #1424).dateutil.zoneinfo module. The module now acts as a wrapper around the tzdata package and will be removed in a future version. Users are encouraged to migrate to dateutil.tz.gettz or the standard library's zoneinfo module. dateutil.zoneinfo.rebuild.rebuild no longer does anything, and by default raises RebuildDeprecationWarning as an error; filter the warning to call it as a no-op. (gh pr #1130)gettz a relative key that refers to a file outside of every directory on TZPATH, such as "../../etc/localtime". By default this now raises dateutil.tz.DeprecatedTzKeyWarning as an error; filter the warning to keep the old behavior for now, or pass an absolute path instead. (gh pr #1130)Version 2.9.0.post0 (2024-03-01)
setuptools_scm to <8, which should make the generated _version.py file compatible with all supported versions of Python.setuptools_scm to <8, which should make the generated _version.py file compatible with all supported versions of Python.Removed a call to datetime.utcfromtimestamp , which is deprecated as of Python 3.12. Reported by Hugo van Kemenade (gh pr #1284 ), fixed by Thomas Gra…
dateutil submodules lazily imported using PEP 562. On Python 3.7+, things like import dateutil; dateutil.tz.gettz("America/New_York") will now work without explicitly importing dateutil.tz, with the import occurring behind the scenes on first use. The old behavior remains on Python 3.6 and earlier. Fixed by Orson Adams. (gh issue #771, gh pr #1007)datetime.utcfromtimestamp, which is deprecated as of Python 3.12. Reported by Hugo van Kemenade (gh pr #1284), fixed by Thomas Grainger (gh pr #1285).Updated tzdata version to 2021a. (gh pr #1128 )
ValueError exceptions would be raisedIllegalMonthError was raised in dateutil code. Fixed by Mark Bailey.repr for dateutil.parser.ParserError, which was notb' prefixes to appear in parse_isodate exceptionisoparse raise when trying to parse times with inconsistent use of: separator. Reported and fixed by @mariocj89 (gh pr #1125).tz.gettz() not returning local time when passed an empty string.parser.parse documentation to reflect the switch fromValueError to ParserError. (gh issue #992, pr #994).rrule module not being displayed in the docs. (gh prtest_imports.py, test_internals.py and test_utils.py to_parser._timelex. Reportedzoneinfo.rebuild to always generate fat binaries. (gh pr #1076).python-build. Reported and fixed byFix typo in setup.cfg causing PendingDeprecationWarning to not be explicitly specified as an error in the warnings filter. (gh pr #966 )
tzoffset and tzstr "strong"ParserError, a subclass ofValueError, which has a nicer string representation. Patch byparser.parse will now raise TypeError when tzinfos is passed aUnboundLocalError instead. Patch bybytes object astz.UTC in favor of tz.tzutc()dateutil.tz was using a backported version ofcontextlib.nullcontext even in Python 3.7 due to a malformedtest_tzlocal_offset_equal would fail in certaintest_isoparser related to bytes/strpytest-style tests and the addition of parametrizationsetup.py to setup.cfg as possible. Fixedparser methods by functionality. Patch byrelease.py over to using pep517.build for creatingsetup.py. Fixed byUpdated tzdata version to to 2018i.
EXDATE parameters when parsing rrule strings.
Reported by @mlorant (gh issue #410), fixed by @nicoe (gh pr #859).tzoffset, tzstr and gettz caches over to using weak
references, so that the cache expires when no other references to the
original tzinfo objects exist. This cache-expiry behavior is not
guaranteed in the public interface and may change in the future. To improve
performance in the case where transient references to the same time zones
are repeatedly created but no strong reference is continuously held, a
smaller "strong value" cache was also added. Weak value cache implemented by
@cs-cordero (gh pr #672, #801), strong cache added by
Gökçen Nurlu (gh issue #691, gh pr #761)dateutil.parser.isoparse function. (gh pr #721)T24:00 to be compliant with the standard. T24:00
now represents midnight on the following day.
Fixed by @cheukting (gh issue #658, gh pr #751)isoparser.parse_isotime was unable to handle the
24:00 variant representation of midnight. (gh pr #773)isoparse.
Reported and fixed by @jayschwa (gh issue #786, gh pr #787).tzfile, and refactored
the way base offset changes are detected. Originally reported on
Stack Overflow by @MartinThoma. (gh issue #812, gh pr #810)tz.gettz when a non-ASCII timezone is passed on
Windows in Python 2.7. (gh issue #802, pr #861)tzname methods.
(gh pr #811)python setup.py test to print an error to stderr and exit
with 1 instead of 0. Reported and fixed by @hroncok (gh pr #814)pyproject.toml file with build requirements and an explicitly
specified build backend. (gh issue #736, gh prs #746, #863)rrule.rrulestr function.
Fixed by @prdickson (gh issue #623, gh pr #762)dateutil.tz.win module and mocked out certain
Windows-specific modules so that autodoc can still be run on non-Windows
systems. (gh issue #442, pr #715)until and count parameters in
rrule. Fixed by @lucaferocino (gh pr #755).parserinfo subclass to parse
non-standard datetime formats in the examples documentation for parser.
Added by @prdickson (gh #753)relativedelta class.
Contributed by @andrewcbennett (gh pr #759)relativedelta module.
Fixed by @nherriot (gh pr #758).dateutil.tz documentation and fixed issue with the
dateutil.tz docstring. (gh pr #714)Data updates ------------ - Update tzdata to 2018g
Updated tzdata version to 2018f.
Update tzdata to 2018e. (gh pr #710)
NaN or infinite value in a
parser.parse, which will raise decimal.Decimal-specific errors. Reported and
fixed by @amureki (gh issue #662, gh pr #679).None.
Reported by @pganssle (gh issue #661) Fixed by @parsethis (gh pr #681)dateutil.tz.gettz. Reported by @pganssle (gh
issue #647). Fixed by @weatherpattern (gh pr #704)tz documentation. (gh issue #702, gh pr
#706)dateutil.tz documentation and fixed issue with the
dateutil.tz docstring. (gh pr #714)parser.parse would raise Decimal-specific errors
instead of a standard ValueError if certain malformed values were parsed
(e.g. NaN or infinite values). Reported and fixed by
@amureki (gh issue #662, gh pr #679).parser where a tzinfos call explicitly returning
None would throw a ValueError.
Fixed by @parsethis (gh issue #661, gh pr #681)rrule with a specified
UNTIL but without an explicitly specified DTSTART; the time zone
of the generated DTSTART will now be taken from the UNTIL rule.
Reported by @href (gh issue #652). Fixed by @absreim (gh pr #693).dateutil.tz.gettz. Reported by @pganssle (gh
issue #647). Fixed by @weatherpattern (gh pr #704)tz documentation. (gh issue #702, gh pr
#706)sphinx_rtd_theme, and changed the sphinx
configuration accordingly. (gh pr #707)dateutil.tz documentation and fixed issue with the
dateutil.tz docstring. (gh pr #714)Fixed an issue with the setup script running in non-UTF-8 environment. Reported and fixed by @gergondet (gh pr #651)
Updated tzdata version to 2018d.
Moved parser module into parser/_parser.py and officially deprecated the use of several private functions and classes from that module. (gh pr #501, #…
Fixed deprecated escape characters in regular expressions. Reported by @nascheme and @thierryba (gh issue #361), fixed by @thierryba (gh pr #358)
Deprecated zoneinfo.gettz() due to confusion with tz.gettz(), in favor of get() method of zoneinfo.ZoneInfoFile objects. (gh issue #11, pr #310)
Fixed parser bug where unambiguous datetimes fail to parse when dayfirst is set to true. (gh issue #233, pr #234)
Fixed parser bug where yearfirst and dayfirst parameters were not being respected when no separator was present. (gh issue #81 and #217, pr #229)
Changed MANIFEST.in to explicitly include test suite in source distributions, with help from @koobs (gh issue #193, pr #194, #201, #221)
Fractional values in absolute parameters (year, day, etc) are now deprecated. (gh issue #40, pr #190)
Fixed issue with parsing of tzstr on Python 2.7.x; tzstr will now be decoded if not a unicode type. gh #51 (lp:1331576), gh pr #55.
Added explicit check for valid hours if AM/PM is specified in parser. (gh pr #22, issue #21)
Fix an issue with relativedelta and freezegun (lp:1374022)
Cleanup directory structure, moved test.py to dateutil/tests/test.py
fuzzy_with_tokens parse addon from Christopher Corley
Updated zoneinfo to 2013h
fuzzy_with_tokens parse addon from Christopher Corley
Bug with LANG=C fixed by Mike Gilbert
Dateutil now works on Python 2.6, 2.7 and 3.2 from same codebase (with six)
New maintainer
Dateutil now works on Python 2.6, 2.7 and 3.2 from same codebase (with six)
#704047: Ismael Carnales' patch for a new time format
Small bug fixes, thanks for reporters!
Ported to Python 3, by Brian Jones. If you need dateutil for Python 2.X, please continue using the 1.X series.
Ported to Python 3, by Brian Jones. If you need dateutil for Python 2.X, please continue using the 1.X series.
There's no such thing as a "PSF License". This source code is now made available under the Simplified BSD license. See LICENSE for details.
As reported by Mathieu Bridon, rrules were matching the bysecond rules incorrectly against byminute in some circumstances when the SECONDLY frequency
As reported by Mathieu Bridon, rrules were matching the bysecond rules incorrectly against byminute in some circumstances when the SECONDLY frequency was in use, due to a copy & paste bug. The problem has been unittested and corrected.
Adam Ryan reported a problem in the relativedelta implementation which affected the yearday parameter in the month of January specifically. This has been unittested and fixed.
Updated timezone information.
- Updated timezone information.
Fixed another parser precision problem on conversion of decimal seconds to microseconds, as reported by Erik Brown. Now these issues are gone for real
Fixed another parser precision problem on conversion of decimal seconds to microseconds, as reported by Erik Brown. Now these issues are gone for real since it's not using floating point arithmetic anymore.
Fixed case where tzrange.utcoffset and tzrange.dst() might fail due to a date being used where a datetime was expected (reported and fixed by Lennart Regebro).
Prevent tzstr from introducing daylight timings in strings that didn't specify them (reported by Lennart Regebro).
Calls like gettz("GMT+3") and gettz("UTC-2") will now return the expected values, instead of the TZ variable behavior.
Fixed DST signal handling in zoneinfo files. Reported by Nicholas F. Fabry and John-Mark Gurney.
Now tzfile will round timezones to full-minutes if necessary, since Python's datetime doesn't support sub-minute offsets. Thanks to Ilpo Nyyssönen for
Now tzfile will round timezones to full-minutes if necessary, since Python's datetime doesn't support sub-minute offsets. Thanks to Ilpo Nyyssönen for reporting the issue.
Removed bare string exceptions, as reported and fixed by Wilfredo Sánchez Vega.
Fix bug in leap count parsing (reported and fixed by Eugene Oden).
Fixed rrule byyearday handling. Abramo Bagnara pointed out that RFC2445 allows negative numbers.
Fixed rrule byyearday handling. Abramo Bagnara pointed out that RFC2445 allows negative numbers.
Fixed --prefix handling in setup.py (by Sidnei da Silva).
Now tz.gettz() returns a tzlocal instance when not given any arguments and no other timezone information is found.
Updating timezone information to version 2005q.
Fixed parsing of XXhXXm formatted time after day/month/year has been parsed.
Fixed parsing of XXhXXm formatted time after day/month/year has been parsed.
Added patch by Jeffrey Harris optimizing rrule.contains.
Removed FREQ_ prefix from rrule frequency constants WARNING: this breaks compatibility with previous versions.
Removed FREQ_ prefix from rrule frequency constants
WARNING: this breaks compatibility with previous versions.
Fixed rrule.between() for cases where "after" is achieved before even starting, as reported by Andreas Köhler.
Fixed two digit zero-year parsing (such as 31-Dec-00), as reported by Jim Abramson, and included test case for this.
Sort exdate and rdate before iterating over them, so that it's not necessary to sort them before adding to the rruleset, as reported by Nicholas Piper.
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.