python-dateutil: parsing, relativedelta and rrule for Python datetimes
Useful extensions to the standard Python datetime features
At a glance
- What is it?
- python-dateutil extends the standard datetime module with flexible date parsing, relative deltas, recurrence rules and timezone implementations. It is a small dependency with a wide surface, and its weak spots are worth knowing before it lands in a codebase.
- Who is it for?
- Adopt python-dateutil when you need to parse dates written by humans, do calendar-aware arithmetic with relativedelta, or generate recurrences with rrule; that is the work the standard library does not do. Skip it for plain ISO 8601 parsing, where datetime.fromisoformat is enough, and for anything that needs a stable, documented deprecation path, because the project's own documentation is inconsistent about which parser features are deprecated.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 7 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 24, 2026, and from our analysis. They are not legal advice.
Star history
- dateutil/dateutil2,647 ★ · +9
| Repository | 2026-10-04 | 2026-11-24 |
|---|---|---|
| dateutil/dateutil | 2.6k | 2.6k |
9 Stars in the last 51 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What python-dateutil adds to the standard datetime module
The standard library's datetime is deliberately narrow. It handles instants, naive and aware, and fixed arithmetic in days and seconds. It does not parse arbitrary date strings, it does not do calendar arithmetic (adding one month to January 31 has no obvious answer), and it ships no timezone database beyond the platform's own. python-dateutil fills those three gaps and a few smaller ones. The README lists the feature set: relative deltas such as next month or last week of month, deltas between two dates, recurrence rules based on a superset of the iCalendar specification, generic parsing of dates in almost any string format, tzinfo implementations for tzfile(5) files, TZ strings, iCalendar files and Windows registry timezones, and Easter Sunday computation for Western, Orthodox and Julian algorithms. The audience is Python developers who receive dates as text from users, logs, CSV files or other systems, and developers who need month-level or weekday-level scheduling rather than second-level arithmetic. The package name on PyPI is python-dateutil; the importable name is dateutil. That mismatch is the source of the most common installation error and the README calls it out explicitly.
How dateutil.parser, relativedelta and rrule fit together
The library is a package of independent submodules rather than one object with many methods, and the README's quick example imports four of them at once: relativedelta, easter, rrule and parser. Each has its own data flow. dateutil.parser.parse takes a string and returns a datetime, inferring the format from the input rather than from a format string; the README's example parses "Sat Oct 11 17:13:46 UTC 2003" and gets back an aware datetime. relativedelta represents a difference in calendar units, so it can express months and years, which timedelta cannot; the README builds one from the Easter date of a computed year and adds it to a date to get the same day six months later. rrule generates dates from a recurrence specification, and the README's example uses rrule(YEARLY, dtstart=now, bymonth=8, bymonthday=13, byweekday=FR)[0] to find the next year in which August 13 falls on a Friday. The timezone side is separate again: tzinfo implementations read tzfile(5) format data from places like /etc/localtime and /usr/share/zoneinfo, and the package ships its own copy of world timezone information based on Olson's database. That last point matters operationally. The tz data moves with the library version, so a container pinned to an old dateutil can carry stale offset rules.
Installing python-dateutil and parsing your first date
Installation is a single pip command. The README notes that the package name differs from the importable name, so the command is not the one you would guess from the import line.
pip install python-dateutilAfter that, `import dateutil` works even though nothing called dateutil was installed. The first useful call is usually the parser, because it accepts formats you did not write a format string for. This snippet parses the same string the README uses and prints the resulting object and its type.
from dateutil.parser import parse
now = parse("Sat Oct 11 17:13:46 UTC 2003")
print(now)
print(type(now))You should see a datetime with a tzinfo attached, because the input carried UTC. For calendar arithmetic, relativedelta is the second thing to reach for. Adding one month to a date with timedelta is not possible; relativedelta handles it.
from datetime import date
from dateutil.relativedelta import relativedelta
today = date(2003, 10, 11)
print(today + relativedelta(months=+6))The README's own example lands on 2004-04-11, six months after the October date. Note that relativedelta is imported from dateutil.relativedelta, not from the top-level package.
Where the permissive parser becomes a liability
dateutil.parser.parse is the feature most people come for and the one most likely to cause a quiet bug. It infers meaning from an ambiguous string. A value like 01/02/2020 is a valid date under both day-first and month-first conventions, and the parser has to choose; the documentation does not promise that the choice matches your users' expectations. The same flexibility means a typo can parse into a plausible but wrong date instead of raising. If your input format is known and fixed, a format string is the safer tool, and for ISO 8601 input the standard library's datetime.fromisoformat covers the common cases without a dependency. The parser is also the part of the library with the most churn: the documentation marks several parser behaviours as deprecated, and the deprecation notes are not consistent across the docs. If you rely on a non-obvious parsing behaviour, pin the version and read the release notes for that specific version rather than assuming the behaviour is contractual. Timezone handling is the other soft spot. The bundled Olson data is only as current as the installed release, and the release history shows a gap: 2.8.2 shipped in July 2021, and 2.9.0 arrived in March 2024. Anyone who needed a timezone rule change during that window was waiting on a release, not on a config toggle.
dateutil vs datetime, and when another library is the better fit
The honest comparison is with the standard library, because that is what you already have. datetime gives you exact instants, fixed-offset arithmetic and ISO 8601 parsing via fromisoformat. It does not guess formats and it does not know about months as units. If your dates arrive as ISO strings from an API and your arithmetic is in seconds, datetime alone is the right answer and adding a dependency buys nothing. The second alternative is a timezone-first library. The README describes tzinfo implementations that read tzfile(5) data from the local machine, from TZ environment strings and from the Windows registry, plus a bundled copy of Olson data. That design predates the zoneinfo module in the standard library, which reads the system timezone database directly and does not ship its own copy. The difference is where the data lives: dateutil carries it in the package, so updates arrive with package updates, while zoneinfo defers to the operating system, so updates arrive with the OS or the tzdata package. For a long-lived container image, the second model usually means fresher rules with less application churn. dateutil remains the better choice when you need parsing and recurrence in the same dependency, since zoneinfo addresses only the timezone question.
Maintenance, releases and what the licence actually says
The repository is not archived, and the last push was on 2026-05-19. The release cadence is the more telling signal: 2.8.2 in July 2021, 2.9.0 in March 2024, and 2.9.0.post0 on the same day as 2.9.0. A post-release that quickly suggests packaging metadata was corrected rather than code. The README lists Paul Ganssle as maintainer from 2015 onward, following Gustavo Niemeyer, Tomi Pieviläinen and Yaron de Leeuw, so the project has passed through several hands and is currently a small-team effort. Upgrade cost is low in normal use, because the public API described in the README has been stable across the 2.x line, but two things raise it. First, the bundled timezone data means a version bump can change offset behaviour for a region, which is a behavioural change even though no API moved. Second, the parser deprecations mean code that depends on undocumented parsing behaviour can break on a minor upgrade. Pin the version, and treat a dateutil bump as a change worth a test run against real input samples. On licensing, the README states that contributions after December 1, 2017 are dual licensed under Apache 2.0 or BSD 3-Clause, while earlier contributions are BSD 3-Clause only unless explicitly relicensed. The repository's licence field reports NOASSERTION, which does not contradict the README; it means the file could not be classified automatically. Read the LICENSE file in the repository before relying on either licence for redistribution, and get legal review if the dual-licence split matters to your distribution model.
Editorial conclusion
Adopt python-dateutil when you need to parse dates written by humans, do calendar-aware arithmetic with relativedelta, or generate recurrences with rrule; that is the work the standard library does not do. Skip it for plain ISO 8601 parsing, where datetime.fromisoformat is enough, and for anything that needs a stable, documented deprecation path, because the project's own documentation is inconsistent about which parser features are deprecated. Verify two things before you commit: which version pip resolves, since the release history shows a three-year gap between 2.8.2 and 2.9.0, and whether your inputs are ambiguous, because dateutil.parser.parse silently picks a reading for strings like 01/02/2020.
Frequently asked questions
Is dateutil built into Python?
No. The README describes dateutil as extensions to the standard datetime module, and installation is a separate pip command. The datetime module itself is standard library; dateutil is not.
Why does Python say "No module named Dateutil"?
The package is not installed, or it was installed under the wrong name. The README notes that the PyPI package name is python-dateutil while the importable name is dateutil, so installing dateutil instead of python-dateutil leaves the import broken.
How do I install the dateutil module in Python?
The README gives one command: pip install python-dateutil. It can be installed from PyPI using pip, and the README repeats that the package name differs from the importable name.
What is dateutil relativedelta?
It is the submodule for relative deltas, such as next month, next year or last week of month. The README's example imports it from dateutil.relativedelta and adds it to a date to move forward in calendar units.
Is dateutil a standard Python library?
No. It is a third-party package installed from PyPI, and the README lists it as providing extensions to the standard datetime module rather than being part of it.
How do I use dateutil.parser?
Import parse from dateutil.parser and pass it a date string, as in the README's example parse("Sat Oct 11 17:13:46 UTC 2003"), which returns a datetime. The parser infers the format from the input, so ambiguous strings are read according to the parser's own rules.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/dateutil-dateutil)Star history chart for your README
[](https://hysenlabs.com/projects/dateutil-dateutil)Was this useful?