Skip to main content

dateutilx - powerful extensions to datetime

Compatibility Py-Version
Quality Checks lint check tests pre-commit
Package pypi-v pypi-downloads
MetaData license-badge

The dateutilx module provides powerful extensions to the standard datetime module, available in Python.

Installation

dateutilx can be installed from PyPI using pip

pip install dateutilx

Download

dateutilx is available on PyPI https://pypi.org/project/dateutilx/

The documentation is hosted at: https://dateutilx.readthedocs.io/en/stable/

Code

The code and issue tracker are hosted on GitHub: https://github.com/rsb-23/dateutilx/

Features

  • Computing of relative deltas (next month, next year, next Monday, last week of month, etc);
  • Computing of relative deltas between two given date and/or datetime objects;
  • Computing of dates based on very flexible recurrence rules, using a superset of the iCalendar specification. Parsing of RFC strings is supported as well.
  • Generic parsing of dates in almost any string format;
  • Timezone (tzinfo) implementations for tzfile (5) format files (/etc/localtime, /usr/share/zoneinfo, etc), TZ environment string (in all known formats), iCalendar format files, given ranges (with help from relative deltas), local machine timezone, fixed offset timezone, UTC timezone, and Windows registry-based time zones.
  • Internal up-to-date world timezone information based on Olson's database.
  • Computing of Easter Sunday dates for any given year, using Western, Orthodox or Julian algorithms;
  • A comprehensive test suite.

Quick example

Here's a snapshot, just to give an idea about the power of the package. For more examples, look at the documentation.

Suppose you want to know how much time is left, in years/months/days/etc, before the next easter happening on a year with a Friday 13th in August, and you want to get today's date out of the "date" unix system command. Here is the code:

>>> from datetime import *
>>> from dateutilx.easter import *
>>> from dateutilx.parser import *
>>> from dateutilx.relativedelta import RelativeDelta
>>> from dateutilx.rrule import *
>>> 
>>> now = parse("Sat Oct 11 17:13:46 UTC 2003")
>>> today = now.date()
>>> year = rrule(YEARLY, dtstart=now, bymonth=8, bymonthday=13, byweekday=FR)[0].year
>>> rdelta = relativedelta(easter(year), today)
>>> print("Today is: %s" % today)
"Today is: 2003-10-11"
>>> print("Year with next Aug 13th on a Friday is: %s" % year)
"Year with next Aug 13th on a Friday is: 2004"
>>> print("How far is the Easter of that year: %s" % rdelta)
"How far is the Easter of that year: RelativeDelta(months=+6)"
>>> print("And the Easter of that year is: %s" % (today + rdelta))
"And the Easter of that year is: 2004-04-11"

Being exactly 6 months ahead was really a coincidence :)

Contributing

We welcome many types of contributions - bug reports, pull requests (code, infrastructure or documentation fixes). For more information about how to contribute to the project, see the CONTRIBUTING.md file in the repository.

Author

The dateutilx module is improved/re-written by rsb-23 in 2026.

License

All contributions after December 1, 2017 released under dual license - either Apache 2.0 License or the BSD 3-Clause License. Contributions before December 1, 2017 - except those those explicitly relicensed - are released only under the BSD 3-Clause License.

Metadata

Release files for dateutilx 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dateutilx 0.4.0
File Size Uploaded Provenance Actions
dateutilx-0.4.0.tar.gz 67.5 kB With provenance Details for dateutilx-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dateutilx 0.4.0
File Interpreter ABI Platform Actions
dateutilx-0.4.0-py3-none-any.whl Python 3 none any Details for dateutilx-0.4.0-py3-none-any.whl

Total release size: 142.7 kB

Release files / dateutilx-0.4.0.tar.gz

Download URL dateutilx-0.4.0.tar.gz
Size 67.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7e21dcb9985c73f379c681bb73b90d54b471741dcbe307a3d48c92dc139147fa
BLAKE2b-256 checksum
How to use checksums
1da63c0eb72ea690b846d5dac028c75e1e11e104c83ebc97fde0ea1cb6746957
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / dateutilx-0.4.0-py3-none-any.whl

Download URL dateutilx-0.4.0-py3-none-any.whl
Size 75.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb20526ef36eb22a2cfabbcf27075158a50feccdb3946e6037aab114db83f3df
BLAKE2b-256 checksum
How to use checksums
8d336ac1139251b129c08d8a6a653ced7370469bf1f1af88e157c50ac85a388d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for dateutilx 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dateutilx-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page