Skip to main content

serp-datetime

UTC date/time written in the Serpentine subset, over serp-time for the clock. Dt is a year/month/day/hour/minute/second dataclass — UTC only, second resolution; timezones (zoneinfo) come later per the roadmap.

API

  • make(y, mo, d, h, mi, s) / make_date(y, mo, d) — validated construction (ValueError with CPython-style messages).
  • now_utc() — current UTC time via serp_time.time().
  • to_unix(dt) -> int / from_unix(ts) -> Dt — proleptic Gregorian, days-from-civil algorithm (valid for any year).
  • iso_format(dt) — YYYY-MM-DDTHH:MM:SS; parse_iso(s) accepts a date or dateTtime (space separator ok).
  • weekday(dt) — 0 = Monday; day_of_year(dt); is_leap(y); days_in_month(y, m).
  • add_days(dt, n), add_seconds(dt, n), diff_seconds(a, b) — timedelta-style arithmetic.

Stdlib classes

date, datetime and timedelta mirror the stdlib constructors with CPython 3.11 validation messages, isoformat(), str/repr parity, comparisons and +/- arithmetic.

  • date.fromisoformat(s) / datetime.fromisoformat(s) — naive values only; the T separator is optional (a space works), a trailing Z is accepted and ignored, fractional seconds are parsed to microseconds. UTC offsets are not supported.
  • datetime.fromtimestamp(ts) — a UTC (not local) datetime, a divergence.
  • datetime.utcnow() / utcnow() — current UTC time.

Install

serp add serp-datetime
pip install serp-datetime

Metadata

Release files for serp-datetime 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 serp-datetime 0.4.0
File Size Uploaded Provenance Actions
serp_datetime-0.4.0.tar.gz 9.7 kB With provenance Details for serp_datetime-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 17.6 kB

Release files / serp_datetime-0.4.0.tar.gz

Download URL serp_datetime-0.4.0.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4f8478edc2615e0461edb5456d0f150223c720cc80f72ced982ae96c12e3ddc8
BLAKE2b-256 checksum
How to use checksums
9211c2c0d4dd5d3f7d8f7271406c43eaa6bf52870bbc9ae574fd139aeff416d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

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

Download URL serp_datetime-0.4.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52c1e0be45088ce1068640eb83dacdf88f39adfc7f5148ceedb978f747332547
BLAKE2b-256 checksum
How to use checksums
dbd58f669b758c3b6c9fc895dabd7e9d06dbbedefec07f496364b8559d9d6a78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Security for serp-datetime 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 serp_datetime-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 Oct 27, 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.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files Full provenance

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