calculate.sh DE

This tool runs in your browser using JavaScript. If it does not appear, please enable JavaScript or reload the page. The description below explains how it works.

Unix Time

A small toolkit for working with Unix time (also called epoch time) - the number of seconds that have elapsed since 1 January 1970, 00:00:00 UTC. The view shows the current time and the current epoch value, and lets you convert a Unix timestamp into a normal date and back.

Current time

The clock shows your local time together with the detected timezone, and the same instant in UTC. Below it you see the current Unix time in seconds (the classic epoch value) and in milliseconds, with a Copy button for the seconds value.

Convert a Unix timestamp into date & time

Type a timestamp into the field - for example 1750000000 - and the matching local time, UTC, and ISO 8601 values appear instantly.

A timestamp can be given in two common units:

  • Seconds - a 10-digit number, for example 1750000000. This is the value you get from date +%s on Linux/macOS, time() in many languages, or System.currentTimeMillis() / 1000 in Java.
  • Milliseconds - a 13-digit number, for example 1750000000000. JavaScript's Date.now(), System.currentTimeMillis() (Java), and int(time.time() * 1000) (Python) all produce this form.

The unit is detected automatically from the number of digits, so either form works without switching settings.

Convert a date & time into a Unix timestamp

Pick a local date and time and the matching timestamp is returned in both seconds and milliseconds, plus the value in UTC. This is handy when you want to build a timestamp for a planned event rather than reading the current one.

Notes

  • The epoch instant is 1970-01-01T00:00:00Z; anything before it is a negative timestamp, which this tool does not accept.
  • A timestamp stored in seconds is limited to the year 2286 for 32-bit values - after that it overflows. This is the so-called Year 2038 problem for the classic 32-bit time_t. The tool itself uses JavaScript numbers, so modern 64-bit-friendly values are no problem.
  • For testing, the timestamp 0 means exactly 1970-01-01T00:00:00Z, and 1000000000 (1 billion seconds) means 2001-09-09T01:46:40Z.