uts is a TypeScript CLI that converts dates to Unix timestamps and back. The build produces a single bundled Node.js executable script.
- Node.js 22+
Usage:
uts --help print help and exit
uts --version [-v] print (extended) version and exit
uts print current unix timestamp
uts <unix timestamp> parse unix timestamp and print date
uts <YYYY-MM-DDTHH:MM:SS> parse datetime in local timezone, print unix timestamp
uts <YYYY-MM-DDTHH:MM:SSZ> parse datetime in UTC, print unix timestamp
uts <YYYY-MM-DDTHH:MM:SS+02:00> parse datetime with given timezone, print unix timestamp
uts <YYYY-MM-DD> <HH:MM:SS> parse date and time and print unix timestamp
uts <YYYY-MM-DD> <HH:MM:SS> <timezone> parse date, time, timezone and print unix timestamp
Print the current Unix timestamp.
uts
1696283053Parse the given Unix timestamp.
uts 1696283053
2023-10-02T23:44:13+02:00Parse the given date using the local timezone.
uts 2023-10-02T23:44:13
1696283053Parse the given date using the UTC timezone.
uts 2023-10-02T21:44:13Z
1696283053Parse the given date using a timezone offset.
uts 2023-10-02T23:44:13+02:00
1696283053Parse the date and time, given as two separate arguments, using the local timezone.
uts 2023-10-02 23:44:13
1696283053Parse the date and time using a timezone offset.
uts 2023-10-02 23:44:13 02:00
1696283053Parse the date and time using a timezone offset.
uts 2023-10-02 14:44:13 -07:00
1696283053Parse the date and time using a named timezone.
uts 2023-10-02 23:44:13 Europe/Berlin
1696283053npm install
npm run build
npm run lintThe build uses esbuild to bundle the CLI into dist/uts with a Node shebang.
brew install kwo/tools/utsHomebrew installs the bundled CLI and declares a node dependency.