A simple timestamp conversion and formatting tool.
bash
python3 skills/timestamp-toolkit/scripts/timestamp.py <action> [options]
ActionDescriptionnowGet current timestampto-datetimeConvert timestamp to datetimeto-timestampConvert datetime to timestampformatFormat datetime stringdiffCalculate time difference
OptionTypeDefaultDescription--inputstring-Input timestamp or datetime--formatstring%Y-%m-%d %H:%M:%SOutput format--tzstringlocalTimezone (local, utc, or timezone name)--unitstringsTimestamp unit (s=seconds, ms=milliseconds)
bash
# Get current timestamp
python3 skills/timestamp-toolkit/scripts/timestamp.py now
# Convert timestamp to datetime
python3 skills/timestamp-toolkit/scripts/timestamp.py to-datetime --input 1700000000
# Convert datetime to timestamp
python3 skills/timestamp-toolkit/scripts/timestamp.py to-timestamp --input "2024-03-22 14:00:00"
# Format datetime
python3 skills/timestamp-toolkit/scripts/timestamp.py format --input "2024-03-22" --format "%Y年%m月%d日"
# Calculate time difference
python3 skills/timestamp-toolkit/scripts/timestamp.py diff --input "2024-01-01" --input2 "2024-03-22"
FormatExampleISO 86012024-03-22T14:00:00ZStandard2024-03-22 14:00:00Chinese2024年3月22日 14:00:00CustomAny Python strftime format
In development.