Date to Unix Timestamp Converter
Convert any date and time to a Unix timestamp in seconds or milliseconds. Supports timezones, ISO 8601, and reverse timestamp-to-date conversion.
About
A Unix timestamp represents the number of seconds elapsed since 1970-01-01T00:00:00Z (the Unix epoch). It is the canonical time representation in POSIX systems, databases, APIs, and logging infrastructure. Getting the conversion wrong by even one hour - a common timezone miscalculation - corrupts event ordering, breaks cache invalidation headers, and produces silent data errors that propagate downstream. This tool performs bidirectional conversion between human-readable dates and Unix timestamps in both seconds (ts) and milliseconds (tms), with explicit timezone offset control. It handles edge cases including dates before the epoch (negative timestamps), leap second boundaries, and the Year 2038 problem threshold at 2,147,483,647.
The converter accepts manual date component entry, ISO 8601 strings, or native datetime picker input. Reverse mode takes a raw timestamp and produces a full UTC and local-time breakdown. Note: this tool assumes the Gregorian calendar and does not account for leap seconds - POSIX time deliberately ignores them, so a day is always exactly 86,400 seconds. Pro tip: always store timestamps in UTC; apply timezone offsets only at the display layer.
Formulas
The Unix timestamp is defined as the total elapsed seconds from the epoch, ignoring leap seconds.
Where ts = Unix timestamp in seconds, Dms = target date in milliseconds since epoch (from Date.getTime()), Ems = epoch reference (0 for Unix). The millisecond variant is simply:
For timezone-adjusted conversion:
Where offset is the timezone offset in hours (e.g., +5.5 for IST, −5 for EST). Reverse conversion from timestamp to date components uses modular arithmetic on ts to extract year, month, day, hour, minute, second via the Gregorian calendar algorithm.
Reference Data
| Milestone / Event | Date (UTC) | Unix Timestamp (s) | Notes |
|---|---|---|---|
| Unix Epoch | 1970-01-01 00:00:00 | 0 | Origin of POSIX time |
| First Moon Landing | 1969-07-20 20:17:40 | −14,182,940 | Negative timestamp (pre-epoch) |
| GPS Epoch | 1980-01-06 00:00:00 | 315,964,800 | GPS week zero |
| 1 Billion Seconds | 2001-09-09 01:46:40 | 1,000,000,000 | Celebrated by programmers |
| Y2K | 2000-01-01 00:00:00 | 946,684,800 | Millennium rollover |
| iPhone Launch | 2007-06-29 00:00:00 | 1,183,075,200 | Start of smartphone era |
| Bitcoin Genesis Block | 2009-01-03 18:15:05 | 1,231,006,505 | Block #0 mined |
| Max 32-bit Signed Int | 2038-01-19 03:14:07 | 2,147,483,647 | Year 2038 problem (Y2K38) |
| Max 32-bit Unsigned | 2106-02-07 06:28:15 | 4,294,967,295 | Unsigned 32-bit overflow |
| 1.5 Billion Seconds | 2017-07-14 02:40:00 | 1,500,000,000 | Another round number |
| 2 Billion Seconds | 2033-05-18 03:33:20 | 2,000,000,000 | Approaching Y2K38 |
| JavaScript Max Safe Date | 275760-09-13 | 8,640,000,000,000 | Date.max in JS (±100M days) |
| NTP Epoch | 1900-01-01 00:00:00 | −2,208,988,800 | Network Time Protocol origin |
| macOS Epoch (Core Data) | 2001-01-01 00:00:00 | 978,307,200 | Apple reference date |
| Windows FILETIME Epoch | 1601-01-01 00:00:00 | −11,644,473,600 | 100-nanosecond intervals |