Date & time · Unix epoch
Date to epoch converter.
Pick a date, a time and the time zone it is in, and get the Unix epoch timestamp. Daylight saving gaps and repeated hours are flagged instead of silently guessed.
Date and time
Result
Choose a date and time to see the epoch timestamp.
How a date becomes epoch time
A clock reading means nothing until you say which time zone it is in. The converter finds that zone's UTC offset for the date you entered, subtracts it, and counts the seconds from 1970-01-01T00:00:00Z. In America/Toronto, 2024-03-05 11:00 is UTC-05:00, so it is 16:00 UTC and 1709654400.
Daylight saving edge cases
When clocks go forward, an hour of local time never happens (in Toronto, 02:30 on 2024-03-10). When they go back, an hour happens twice (01:30 on 2024-11-03). The page tells you which case you hit; skipped times are read with the offset from before the change, and repeated times use the earlier occurrence.
Date to epoch in code
| Language | Now | Timestamp to date | Date to timestamp |
|---|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | new Date(1709654400 * 1000).toISOString() | Math.floor(Date.parse('2024-03-05T16:00:00Z') / 1000) |
| Python | int(time.time()) | datetime.fromtimestamp(1709654400, tz=timezone.utc) | int(datetime(2024, 3, 5, 16, tzinfo=timezone.utc).timestamp()) |
| Go | time.Now().Unix() | time.Unix(1709654400, 0).UTC() | time.Date(2024, 3, 5, 16, 0, 0, 0, time.UTC).Unix() |
| Java | Instant.now().getEpochSecond() | Instant.ofEpochSecond(1709654400L) | Instant.parse("2024-03-05T16:00:00Z").getEpochSecond() |
| PostgreSQL | SELECT EXTRACT(EPOCH FROM now())::bigint; | SELECT to_timestamp(1709654400); | SELECT EXTRACT(EPOCH FROM timestamptz '2024-03-05 16:00:00+00'); |
| SQLite | SELECT unixepoch(); | SELECT datetime(1709654400, 'unixepoch'); | SELECT unixepoch('2024-03-05 16:00:00'); |
FAQ
How do I convert a date to epoch time?
Enter the date and time, choose the time zone it is in, and read the Unix seconds. Milliseconds, microseconds and nanoseconds are shown too.
Why does the time zone change the epoch value?
Because 11:00 in Toronto and 11:00 in London are different moments. The same wall clock reading in a zone further east is earlier, so its timestamp is smaller.
What happens during a daylight saving change?
A time that is skipped by the clock has no true timestamp, so it is read with the earlier offset. A time that happens twice has two valid timestamps; the earlier is shown and the later one is reported alongside it.
What is Unix epoch time?
Unix time counts seconds since 00:00:00 UTC on 1 January 1970, the Unix epoch. POSIX defines it so that every day is exactly 86,400 seconds, which is why 1970-01-02T00:00:00Z is 86400.
Does Unix time include leap seconds?
No. POSIX counts each day as exactly 86,400 seconds, so a leap second is not a separate value: the timestamp repeats or is smeared by the system clock, and 2017-01-01T00:00:00Z is 1483228800 even though UTC itself had a leap second added at the end of 2016. IERS Bulletin C 72 (July 2026) announced that no leap second will be introduced at the end of December 2026.
Can a Unix timestamp be negative?
Yes. A negative value is a moment before 1970-01-01, for example -1 is 1969-12-31T23:59:59Z. POSIX leaves the formula undefined before 1970, but most languages extend the same arithmetic backwards and so does this tool.
Is my data sent anywhere?
No. The conversion runs in your browser and nothing you type is uploaded or stored.
Sources (each opened 2026-10): POSIX.1-2017 Base Definitions, 4.16 Seconds Since the Epoch; RFC 3339, Date and Time on the Internet: Timestamps; ECMAScript Language Specification, Time Values and Time Range; IERS Bulletin C 72 (leap second announcement, July 2026); Python documentation, datetime; Python documentation, time; Go documentation, package time; Java SE 21 API, java.time.Instant; PostgreSQL documentation, Date/Time Functions; SQLite documentation, Date And Time Functions.