Date and time tools

Convert Unix timestamps and timezones, count the days between dates, work out an exact age, and build or explain cron expressions.

Which tool to use

Things that trip people up

  • Seconds or milliseconds. For present-day dates a timestamp in seconds has 10 digits and one in milliseconds has 13. Mixing them up gives a date in 1970 or tens of thousands of years ahead.
  • A Unix timestamp has no timezone. It counts seconds since 1 January 1970 at 00:00 UTC. A timezone only applies when the value is displayed.
  • Cron runs on the server's clock. A job set for 9 in the morning fires at 9 in whatever timezone the scheduler uses, which is often UTC.
  • Months are not a fixed length. The gap between two dates in months depends on the calendar, not on dividing days by 30.

Frequently asked questions

What is a Unix timestamp?
It is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970, not counting leap seconds. It is a compact, timezone-free way to store a moment in time.
How can I tell whether a timestamp is in seconds or milliseconds?
Count the digits. A current timestamp in seconds has 10 digits, and one in milliseconds has 13. JavaScript uses milliseconds; most Unix tools and databases use seconds.
What do the five fields of a cron expression mean?
In order they are minute, hour, day of the month, month and day of the week. An asterisk means every value, so 0 9 * * 1 runs at 09:00 every Monday.
Does a Unix timestamp change with the timezone?
No. The same instant has the same timestamp everywhere. Only the human-readable date derived from it changes with the timezone.