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.

time2range

Given a time_t, compute the start/end boundaries of the surrounding time period (the hour, day, week, month or year it falls in).

Usage

time2range -t <time_t> -p <type> [-r <range>] [-z <TZ>]

The timestamp is the -t option, not a positional argument.

OptionPurpose
--time_t / -tEpoch seconds (or date string) — required
--type / -phours | days | weeks | months | yearsrequired
--range / -rInteger offset (e.g. previous/next period)
--TZ / -zTime zone

Prints Start: … End: ….

See also