TimestampUnix

date → timestamp

Date to Unix Timestamp Converter

Pick a date, a time and an IANA timezone — the tool computes the exact Unix instant in seconds, milliseconds, microseconds and nanoseconds. Timezone handling is explicit because a wall-clock reading only becomes a single instant once you say where it happens.

A timezone is required — the same local date and time is a different instant in each zone.

Date to timestamp in code

// JavaScript — ISO string with offset
Math.floor(Date.parse('2026-09-19T12:30:00Z') / 1000);   // seconds

// JavaScript — a specific timezone without Temporal
new Intl.DateTimeFormat('en-US', { timeZone: 'America/New_York' });

// Python
from datetime import datetime, timezone
int(datetime(2026, 9, 19, 12, 30, tzinfo=timezone.utc).timestamp());

// PHP
strtotime('2026-09-19 12:30:00 UTC');

// PostgreSQL
EXTRACT(EPOCH FROM TIMESTAMP '2026-09-19 12:30:00+00')::bigint;

Common mistakes

Free-form date input

Prefer typing the date yourself? The universal converter below accepts ISO 8601, RFC 2822 (Sat, 19 Sep 2026 12:30:00 GMT), plain2026-09-19 12:30:00 and bare timestamps. Date-times without an offset are interpreted in the timezone you select.

Interpret input as

Accepts Unix timestamps (s / ms / µs / ns), ISO 8601, RFC 2822 and common date strings.

Frequently asked questions

Why does the converter need a timezone?
A local date and time like "September 19, 2026 12:30" is not a single instant — it happens at different moments in Tokyo, London and New York. A Unix timestamp identifies one absolute instant, so converting a wall-clock reading requires knowing which zone that reading is in. Dates entered with an explicit offset (like Z or +05:30) need no extra timezone.
How do I get the current timestamp for "now"?
Press the Now button — it fills in the current local date and time in the selected zone. Or in code: Math.floor(Date.now() / 1000) in JavaScript, time() in PHP, int(time.time()) in Python.
What timestamp does midnight become?
Midnight depends entirely on the zone. 2026-09-19 00:00:00 is 1789776000 in UTC but 1789790400 in America/New_York (EDT, UTC−4) — four hours later in absolute time. Always state the zone when you talk about "midnight".
What happens with daylight-saving transitions?
Times inside a spring-forward gap (e.g. 02:30 on a day when clocks jump 02:00 → 03:00) do not exist; this converter shifts them forward by the gap, matching Java's ZonedDateTime. Ambiguous fall-back times resolve to the earlier of the two possible instants.

Related tools