Skip to content

Convert Time And Timezones

leo time accepts Unix seconds, Unix milliseconds, and common date-time strings. With no value, it uses the current time.

Terminal window
leo time
leo time 1783512043
leo time 1783512043000
leo time "(2026-07-08 20:00:43)"

A numeric value with at least 13 digits is parsed as milliseconds; shorter values are seconds. Dates support - or / separators, optional seconds, RFC 3339, and forms with an explicit offset.

--from controls the input timezone for a date string without an explicit timezone, while --to controls the primary output timezone. Both accept a UTC offset or IANA name and default to +8:

Terminal window
leo time "2026-08-06 22:26:09" --from -4
leo time 1783512043 --to +9
leo time "2026-07-08 20:00:43" --to Asia/Tokyo

The first example interprets the date in UTC-4 and prints the same instant as 2026-08-07 10:26:09 in UTC+8. Unix timestamps and dates with an explicit timezone are not affected by --from. Entries in time.zones add common-timezone rows; a zone equal to the primary output is not printed twice.