Epoch converter / 02

Date to Unix timestamp

Turn a calendar date in UTC or a named IANA time zone into Unix seconds, milliseconds, microseconds or nanoseconds.

From a calendar value to an instant

Choose UTC or a named IANA time zone before converting. The input uses an unambiguous year-month-day control, so values such as 03/04/26 cannot silently change between regional date conventions. The selected zone determines the instant; changing only the output unit does not.

Seconds or milliseconds?

Seconds are common in Unix utilities and many backend systems. Milliseconds are the native unit for JavaScript Date. Microseconds and nanoseconds are used by some databases and event pipelines; choosing a finer unit adds zeros when the source input has only millisecond precision.

Daylight-saving caveat

Named-zone wall times can be missing or repeated during daylight-saving transitions. The converter rejects a nonexistent time during the spring-forward gap. If the clock repeats a local time in autumn, it shows both UTC offsets and asks you to choose the intended instant.

How to use this tool

Enter a calendar date and time, select the zone in which that clock reading was observed, then choose the output unit and press Convert. The source zone interprets the date; it is not merely a label applied to a result.

Worked input and output

Input or settingExpected result
2023-11-14 22:13:20 · UTC · s1700000000
2023-11-15 06:13:20 · Asia/Shanghai · ms1700000000000
2023-11-14 22:13:20.123 · UTC · ms1700000000123

Checks before using the result

During a daylight-saving overlap, select the earlier or later offset explicitly. A skipped wall time is rejected. Whole-second output rounds down if the source has a fraction; choose milliseconds or a finer unit to retain supported input precision. Use the DST examples to distinguish a missing time from an invalid calendar date.

Frequently asked questions

Why must I choose the input time zone?

The same calendar fields identify different instants in different zones. An explicit input zone makes the result unique and reproducible.

How are daylight-saving transitions handled?

The converter rejects nonexistent spring-forward times and presents both UTC offsets when a fall-back local time occurs twice.

Does selecting nanoseconds increase the input precision?

No. The date input has millisecond precision; a finer output unit represents the same instant with additional trailing zeros.

Tools / 01—06

More timestamp tools

Each route starts with a specific input and gives a specific answer.