Date to Unix Timestamp
Pick a date, choose whether you mean it in UTC or in your local timezone, and get epoch seconds and milliseconds. The toggle exists because that choice is the single biggest source of wrong timestamps on the internet.
CONVERT CALENDAR DATE TO TIMESTAMP
Date output is floored to milliseconds. Choose a unit explicitly for older dates or values outside auto-detection.
Typical today: 10 (s), 13 (ms), 16 (µs), 19 (ns) digits. A unit heuristic, not a definition. Nnow Ccopy /focus
Local means your device timezone. During a repeated daylight-saving hour, the earlier occurrence is used; use UTC to choose an unambiguous instant.
A date without a timezone is not a timestamp
"2026-03-15 09:00" can name many different instants depending on the timezone you assume. Offsets are not all whole hours, and some regions change offset across daylight-saving transitions. When you convert a calendar date to epoch time you must state the timezone; tools that silently assume one are the reason scheduled jobs fire an hour early every spring.
- JavaScript parses date-only and date-time strings differently. Per spec,
Date.parse("2026-03-15")means midnight UTC, whilenew Date("2026-03-15T09:00")means local time — the same-looking string, two conventions, hours apart. - ISO 8601 without an offset is explicitly local ("local time" in the spec wording), but many parsers treat it as UTC anyway. If a value round-trips wrong by your UTC offset, this is why.
- DST can create gaps and overlaps. In regions such as America/New_York under current rules, 02:00–02:59 is skipped at the spring transition and 01:00–01:59 repeats in autumn. Other regions use different transition times or sizes. Resolve the named region and any ambiguity before converting to UTC.
Use the UTC/Local toggle on the converter above: it does exactly this — the toggle picks which timezone the wall-clock input is interpreted in.
The missing-seconds trap
Many systems drop the fractional-second part when they log an epoch value — 1712345678.901 becomes 1712345678 — but some systems drop whole minutes or write only up to the hour. A truncated timestamp converts to a perfectly plausible-looking date that is silently wrong by minutes or hours. Sanity checks that catch it:
- If you converted a date and it is exactly 0 seconds past a suspiciously round wall time, check whether the source truncated anything.
- Cross-check against an adjacent field: a log line usually carries both an epoch column and a human date column — if they disagree by 1,000×, that is a unit bug, not truncation; if they disagree by a whole hour, that is a timezone bug.
- When in doubt, keep milliseconds. Truncation to seconds loses up to 999 ms of ordering information; truncation of displayed precision (e.g.
%H:%Mformats) hides up to 59 s.
ANSWERS
01 What is the Unix timestamp for 2026-01-01 00:00 UTC?
1767225600 seconds (1767225600000 milliseconds). Feed the date into the converter above with the toggle on UTC to reproduce it, and any other midnight for comparison.
02 Why does new Date("2026-01-01") show December 31 in my timezone?
Because date-only ISO strings are parsed as midnight UTC, and your local timezone renders that as the previous evening. It is not a bug in the library — it is the spec's deliberate (and often surprising) convention for date-only vs date-time strings.
03 Should I store seconds or milliseconds?
Store milliseconds if you need sub-second ordering (databases, rate limits, latency math); store seconds if you are interacting with APIs, cron or anything POSIX. Whatever you pick, write the unit down — a bare 1712345678 in a schema is seconds by convention only, and the 13-digit cousin looks almost identical.
04 How do I convert a date in another timezone, like Asia/Tokyo?
For modern dates, 09:00 in Asia/Tokyo is 00:00 UTC because Japan uses UTC+9 year-round. This tool offers UTC or your device’s local zone, not arbitrary IANA regions. For another region, resolve the date with an IANA-aware library and its DST rules first; a UTC display cannot determine the region’s offset or resolve a repeated wall time.
05 Is a negative timestamp valid?
Yes — it is simply a date before 1970-01-01. -86400 is 31 December 1969. Most languages parse and display these correctly; a few web-facing parsers reject them, which matters if you deal with historical dates.