Unix time ⇄ date
The current Unix time, and timestamps to dates and back, in seconds or milliseconds.
The formats appear when the time is set.
The commands appear when the time is set.
Calculated in your browser — nothing is sent to the server
Practice on a machine
Lab “The portal fails over HTTPS”
In a Linux terminal
date +%s
# now, in seconds
date +%s%3N
# now, in milliseconds
date -d @1790676000
# timestamp → local date
date -u -d @1790676000 +'%F %T'
# timestamp → UTC date
date -d '2026-09-29 13:00' +%s
# date → timestamp
On macOS and BSD, use date -r 1790676000 instead of date -d @….
Keep in mindJavaScript and Java count in milliseconds (13 digits); Linux and most databases in seconds (10 digits).
FAQ
How do I tell seconds from milliseconds?
By length: a timestamp in seconds has 10 digits today, in milliseconds 13. A date in 1970 means milliseconds were read as seconds.
Why is the date off by a few hours?
The timestamp is the same everywhere, but the date depends on the time zone: date -d @… uses the
system zone, while logs and databases often use UTC.
What is the year 2038 problem?
On 19 January 2038 at 03:14:07 UTC, the timestamp outgrows a signed 32-bit integer, and where
time_t is 32-bit, time jumps back to 1901. 64-bit Linux is not affected.