Skip to main content

GenUTCStamp

A tiny, dependency-free Python utility that returns a UTC timestamp string in the form:

YYYY-MM-DDTHH:MM:SSZ

This format is ISO 8601 compatible and commonly accepted as an RFC 3339-style timestamp (UTC “Zulu” suffix Z). The implementation uses only the Python standard library time module.

Why this package exists

You often may need a stable UTC timestamp string for:

  • log lines and structured logs
  • environment-variable status markers
  • lightweight monitoring / alerting breadcrumbs
  • file naming or report identifiers

When the goal is “a portable UTC timestamp string with no dependencies,” this package provides that.

Installation

python -m pip install --upgrade pip
python -m pip install GenUTCStamp

Quick usage

Note: Python imports are case-sensitive on Linux. pip install GenUTCStamp works regardless of casing, but import GenUTCStamp and import genutcstamp are different names. This project supports both.

Canonical import (recommended):

import GenUTCStamp as utc

print(utc.utc_ts())

Compatibility import (useful on Linux or if you prefer lowercase imports):

import genutcstamp as utc

print(utc.utc_ts())

API surface (aliases)

All public functions return the exact same value format and are simple aliases for convenience:

  • GenerateUTCTimestampPortable()
  • utc_ts()
  • GenerateUTCTimestamp()
  • GenerateTimestamp()
  • gen_ts()
  • GenTs()
  • gen_utc()
  • GenerUTC()
  • GenUTC()
  • GenUTCToString()
  • gen_utc_str()
  • UTCToString()
  • utc_to_str_threadsafe()
  • GenUTCStamp()

Output guarantees

  • Always returns a string.
  • Normal path returns UTC time formatted as YYYY-MM-DDTHH:MM:SSZ.
  • On unexpected runtime failures, returns a defensive fallback string: 1970-01-01T00:00:00Z.

Command line

This package optionally provides a small CLI:

utc-ts
utc-ts -n 5
utc-ts --n 5

License

MIT

Metadata

Release files for GenUTCStamp 1.0.3

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

Source distribution (sdist)

Source distribution for GenUTCStamp 1.0.3
File Size Uploaded
genutcstamp-1.0.3.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for GenUTCStamp 1.0.3
File Interpreter ABI Platform
genutcstamp-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / genutcstamp-1.0.3.tar.gz

Download URL genutcstamp-1.0.3.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a01a67cd8f79edbe084998895c7deec90b7179b1b5869e6fefa36b478fc4f5c5
BLAKE2b-256 checksum
How to use checksums
030cbe4d53d04a604cd39313494daad19abbe1aca4561a8d2742e0ea08415a1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / genutcstamp-1.0.3-py3-none-any.whl

Download URL genutcstamp-1.0.3-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9d3150569263e4620e671303362ec101f3e2f3215c0dd29d6cd1b11970427e6
BLAKE2b-256 checksum
How to use checksums
02779bf57d6d126efe17244bc22baa889247520bf312f687e6506e8cee348486
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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