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.
- Unix Timestamp Converter: Epoch seconds or milliseconds to a readable date, and back.
- Epoch Clock: The current Unix timestamp, live, in seconds and milliseconds.
- Timezone Converter: Convert a time between cities, with DST handled.
- Days Between Dates: The exact time between two dates, in days, weeks, months and years.
- Age Calculator: Exact age in years, months and days, and the next birthday.
- Cron Expression Generator: Describe a schedule in words and get the cron expression.
- Cron Expression Parser: Explain a cron expression in words and list its next run times.
Which tool to use
- A number from a log or an API: the Unix Timestamp Converter turns epoch seconds or milliseconds into a readable date, and back. The Epoch Clock shows the current timestamp live.
- A meeting across regions: the Timezone Converter converts a time between cities with daylight saving handled.
- A span of time: Days Between Dates gives days, weeks, months and years, and the Age Calculator gives an exact age and the next birthday.
- A scheduled job: the Cron Expression Generator turns a schedule described in words into a cron expression, and the Cron Expression Parser explains an existing one and lists its next run times.
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.