Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

time2date

Convert a Unix time_t (optionally milliseconds) to ASCII date/time, and vice-versa, in UTC, local and a given time zone.

Usage

time2date [TIME_T]            # no arg => current time; also accepts a date string
OptionPurpose
[TIME_T]Epoch seconds, or an ISO-ish date string (optional positional)
--TZ / -zTime zone for the conversion
--miliseconds / -mTreat the input as milliseconds

Prints the timestamp (and its hex form) plus UTC + local (and named-TZ) ISO-8601 strings and yday.

See also