whenever
Modern datetime library for Python
Decision gist · record as of 2026-08-14
Yes. Whenever solves real, well-documented pitfalls in Python's datetime module—particularly DST arithmetic and type safety—that affect any application working with timezones. It has low install friction, active maintenance, no known vulnerabilities, and permissive licensing. The API is pre-1.0 and may change, but type checking will catch those changes. Install it if you work with timezones or need to prevent datetime mixing bugs; skip it only if you never cross timezone boundaries or can tolerate standard library footguns.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction: pure Python wheel, only two runtime dependencies (tzdata, tzlocal).
- Actively maintained with a release 7 days ago and 2374 GitHub stars.
License · maintenance · safety
MIT (permissive) — MIT license (permissive). Binary wheels include Rust dependencies under similarly permissive licenses (MIT, Apache-2.0, others), with license details included in distributions.
last release 2026-08-07 (7 days) · last repo commit 2026-08-12 · 2,374 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 6,877,731 downloads/mo, #1,826 on PyPI
Alternatives
Verify before relying
pip install whenever
from whenever import Instant, ZonedDateTime, PlainDateTime
now = Instant.now()
party = PlainDateTime("2023-10-28 22:00").assume_tz("Europe/Amsterdam")
party_end = party.add(hours=6) # DST-safe arithmetic- Whether the pure-Python fallback is automatically selected or requires explicit configuration.
- Performance comparison with standard library datetime for typical use cases.
- SQLAlchemy and Pydantic integration maturity beyond 'beta' status.
What it is and what it does
Whenever is a modern datetime library that addresses two core limitations of Python's standard library: it handles Daylight Saving Time correctly during arithmetic operations (e.g., adding hours across a DST boundary), and it uses distinct types to enforce type-safe distinction between naive and aware datetimes at compile time. The library provides three main types—Instant (UTC moments), ZonedDateTime (timezone-aware local times), and PlainDateTime (naive local times)—each with explicit semantics that prevent accidental mixing.
The package is available in two implementations: a Rust-backed version for performance and a pure-Python fallback for compatibility. It supports nanosecond precision, date arithmetic, common datetime formats (ISO8601, RFC3339, RFC2822), and integration with SQLAlchemy and Pydantic. The API is fully typed and follows semantic versioning; until version 1.0, minor releases may introduce breaking changes, though the type system helps identify necessary adjustments.
Use it for
- Schedule events across DST transitions without silent hour-skipping bugs.
- Enforce type safety in APIs where functions must work only with aware or only with naive datetimes.
- Parse and format datetimes in standard formats (ISO8601, RFC2822) with full timezone awareness.
- Perform timezone conversions and comparisons with correct DST handling.
- Build datetime-heavy applications (e.g., scheduling, logging) where correctness is critical.
- Migrate from Arrow or Pendulum when DST correctness and type safety become requirements.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Whenever solves real, well-documented pitfalls in Python's datetime module—particularly DST arithmetic and type safety—that affect any application working with timezones. It has low install friction, active maintenance, no known vulnerabilities, and permissive licensing. The API is pre-1.0 and may change, but type checking will catch those changes. Install it if you work with timezones or need to prevent datetime mixing bugs; skip it only if you never cross timezone boundaries or can tolerate standard library footguns.
Install
whenever on PyPI
Before you install
Low friction: pure Python wheel, only two runtime dependencies (tzdata, tzlocal). Actively maintained with a release 7 days ago and 2374 GitHub stars. Supports Python 3.10–3.15 and PyPy.
Requires Python 3.10 or later.
License in practice
MIT license (permissive). Binary wheels include Rust dependencies under similarly permissive licenses (MIT, Apache-2.0, others), with license details included in distributions.
Quickstart
pip install whenever
from whenever import Instant, ZonedDateTime, PlainDateTime
now = Instant.now()
party = PlainDateTime("2023-10-28 22:00").assume_tz("Europe/Amsterdam")
party_end = party.add(hours=6) # DST-safe arithmetic
Verify before relying
- Whether the pure-Python fallback is automatically selected or requires explicit configuration.
- Performance comparison with standard library datetime for typical use cases.
- SQLAlchemy and Pydantic integration maturity beyond 'beta' status.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagestzdatatzlocal |
| Maintenance | Actively maintained 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,877,731 / month, #1,826 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: Free Threading :: 2 - BetaProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: RustTyping :: Typed |
Evidence: whenever-0.10.5-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “dst-safe datetime library”
- wheneverWhenever provides type-safe, DST-aware datetime handling for Python…
- deloreanDelorean simplifies Python datetime manipulation by wrapping the…
- udatetimeudatetime provides fast RFC3339-compliant date-time parsing,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also datetype · pendulum · SQLAlchemy-Utc · times · pytz · backports.zoneinfo · dateformat · iso8601 · udatetime · DateTimeRange