Timestamp Converter

Convert Unix timestamps and date strings between formats, parse dates, handle timezones, calculate differences, and add seconds with timezone support.

Install

openclaw skills install @fuzzyb33s/timestamp-converter

Timestamp Converter

Convert Unix timestamps to readable dates and vice versa. Pure Python stdlib.

Usage

bash
python scripts/timestamp_converter.py convert <timestamp>          # Unix → readable
python scripts/timestamp_converter.py parse "<date string>"        # Parse date string
python scripts/timestamp_converter.py now [--unix] [--iso]         # Current time
python scripts/timestamp_converter.py diff <ts1> <ts2>             # Time difference
python scripts/timestamp_converter.py add <timestamp> <seconds>    # Add/subtract seconds

Options

FlagDescription
--tzTimezone (e.g., UTC, America/New_York, Europe/London). Default: local.
--formatCustom strftime format
--unixOutput as Unix timestamp
--isoOutput as ISO 8601
--msTimestamp in milliseconds

Examples

InputOutput
convert 17507904002026-06-24 00:00:00 UTC
convert 1750790400000 --ms2026-06-24 00:00:00 UTC
parse "2026-06-24 12:30:00"1750786200
now --unix1750791742
now --iso2026-06-24T07:09:02+02:00
diff 1750790400 17507940001h 0m 0s
add 1750790400 36001750794000 -> 2026-06-24 01:00:00

Notes

  • Timestamps in milliseconds auto-detected (13+ digits)
  • Supports relative dates: "yesterday", "tomorrow", "next monday"
  • Use --tz flag for timezone-aware conversions