Skip to content

Releases: markusmobius/go-dateutil

Release list

v2.9.1

Choose a tag to compare

@markusmobius markusmobius released this 13 Sep 22:17

Go-Dateutil v2.9.1

Native Go shared date compatibility for HtmlDate and DateParser. The upstream baseline remains python-dateutil 2.9.0.post0; CPython compatibility is separately pinned to 3.14.6.

Changes

  • Add compat/datetime.FromISOFormat with CPython calendar/week dates, midnight rollover, microsecond offsets, and rejection behavior.
  • Add compat/datetime.Timestamp with local naive gap/fold resolution and Python-compatible floating-point rounding.
  • Add explicit parser.LocalTimezone / ParseWithLocalTimezone and fold state; preserve naive wall fields through DST gaps.
  • Expose the existing Python Unicode decimal helper for consumers. No runtime dependencies or worker threads were added.
  • Update README installation and API documentation; retain source provenance, independent fixtures, and the original CPython license.

Verification

17,256 independent Python-derived comparisons across lexer, parser, relative arithmetic, ISO parsing, parser contexts, and timestamps. Passed Linux Go 1.26.0/1.27.1, native Windows Go 1.27.1, race tests, vet, module verification/tidiness, and byte-identical pinned-Python regeneration.

This is the documented shared subset, not every Dateutil or CPython API. Complete HtmlDate integration remains a separate consumer gate. Existing v2.9.0 tags and fixtures are unchanged.

go get github.com/markusmobius/go-dateutil/v2@v2.9.1

v2.9.0

Choose a tag to compare

@markusmobius markusmobius released this 13 Sep 17:28

Compatibility

Go-Dateutil 2.9.0 implements the subset of python-dateutil 2.9.0.post0 used by Python HtmlDate and DateParser. It is not a complete port of dateutil. Python's .post0 packaging suffix is recorded in the README and source-provenance ledger; the Go module uses semantic version v2.9.0 and the /v2 module path.

Included Functionality

  • Default English, non-fuzzy parsing with explicit defaults and parser year, Python-compatible tokenization and calendar resolution, timezone awareness, and numeric offsets.
  • Relative years, months, weeks, days, hours, minutes, seconds, and microseconds, with month-end clamping and Python fractional arithmetic.
  • Native Go only: no Python runtime, CGO, external runtime dependencies, or internal worker threads. Callers own concurrency.

Tests Included In The Package

  • 3,273 lexer comparisons against Python token streams.
  • 3,273 parser comparisons covering accepted dates and rejected inputs, default fields, calendar/clock fields, fractional seconds, and timezone awareness/offsets.
  • 146 relative-arithmetic comparisons covering month ends, leap years, mixed/fractional units, overflows, and DST gaps/folds.

The test sources, saved Python fixtures, and opt-in reference generator are included. Normal go test -mod=readonly ./... does not require Python or another checkout. The generator pins CPython 3.14.6, dateutil 2.9.0.post0, source hashes, Unicode data, and timezone data; regeneration was byte-identical.

All comparisons passed on Linux with Go 1.26.0 and 1.27.1 and natively on Windows with Go 1.27.1. Linux race tests, vet, module tidiness, and an isolated source-archive test also passed. CI runs the offline suite on Linux and Windows with minimum and stable Go.

Installation

go get github.com/markusmobius/go-dateutil/v2@v2.9.0

Requires Go 1.26.0 or later. Import the parser or relativedelta subpackage. See README and UPSTREAM.md for the deliberately unsupported APIs and timezone/error representation boundaries. Full HtmlDate/DateParser consumer parity is a separate qualification, not a claim of this subset release.