time-format-cli
v1.0.0
Published
CLI tool to convert between Unix timestamps, ISO dates, and human-readable time formats
Maintainers
Readme
time-format-cli
CLI tool to convert between Unix timestamps, ISO 8601, RFC 2822, and human-readable time formats. Zero dependencies.
Install
npm install -g time-format-cliUsage
# Convert Unix timestamp to ISO
time-format 1700000000
# 2023-11-14T22:13:20+08:00
# Convert ISO to Unix
time-format "2023-11-14T22:13:20Z"
# 1700000000
# Human-readable format
time-format "2026-05-23" --output human
# Sat, May 23, 2026 00:00
# UTC mode
time-format 1700000000 --utc
# All formats at once (JSON)
time-format now --output json --utc
# RFC 2822
time-format now --output rfcOptions
| Flag | Description | Default |
|------|-------------|---------|
| -o, --output | Output format: unix, iso, human, rfc, json | auto-detect |
| -u, --utc | Display UTC instead of local time | off |
Input Formats (auto-detected)
- Unix timestamp (seconds) —
1700000000 - Unix timestamp (ms) —
1700000000000 - ISO 8601 —
2026-05-23T10:00:00Z - Date strings —
2026-05-23,May 23 2026 now/ no input — current time
Use Case
Quick timestamp conversions in the terminal — no more opening a browser or date -d @1234 that doesn't work across BSD/GNU.
