How a unix timestamp converter works
A Unix timestamp is the number of seconds since 00:00:00 UTC on 1 January 1970, a moment called the Unix epoch. The number 1710055800 means 1,710,055,800 seconds after that moment, which is 07:30 UTC on 10 March 2024. A unix timestamp converter does that arithmetic for you in both directions and adds the calendar and time zone rules on top.
This tool works line by line. A number becomes a date, a date becomes a number, and a log line that contains epoch times gets those times replaced in place. Everything runs in your browser; see the Privacy Policy for what that means.
1710055800 → 2024-03-10T07:30:00Z
1710055800123 → 2024-03-10T07:30:00.123Z
1710055800123456789 → 2024-03-10T07:30:00.123456789Z
-86400 → 1969-12-31T00:00:00Z
2147483648 → 2038-01-19T03:14:08Z
2024-03-10T02:30:00-05:00 → 1710055800
Sun, 10 Mar 2024 07:30:00 GMT → 1710055800
2024-07-04 18:00 → 1720116000Seconds, milliseconds, microseconds or nanoseconds
Different systems count in different units. Unix shells, PHP and most databases use seconds. JavaScript's Date.now() and Java's System.currentTimeMillis() use milliseconds. Python's time.time_ns() and Go's UnixNano() use nanoseconds, and some logs use microseconds. Reading a millisecond value as seconds lands you tens of thousands of years in the future, so the unit matters.
With Input unit set to Auto, the tool picks the unit from the size of the number. Up to 11 digits is read as seconds, then milliseconds, microseconds and nanoseconds. The details panel says which unit was used. Set Input unit by hand when you know better, for example for a 12-digit value that is really seconds.
Digits Unit picked Example Result
10 seconds 1710055800 2024-03-10T07:30:00Z
13 milliseconds 1710055800123 2024-03-10T07:30:00.123Z
16 microseconds 1710055800123456 2024-03-10T07:30:00.123456Z
19 nanoseconds 1710055800123456789 2024-03-10T07:30:00.123456789ZDate formats the converter reads
Dates do not need to be in one strict format. The parser reads the forms that show up in APIs, logs, emails and spreadsheets. When a date has no offset or zone name, it is read in the zone picked under Time zone, and a note says so.
- ISO 8601 and RFC 3339:
2024-03-10T07:30:00Z,2024-03-10T02:30:00-05:00, with up to nine fraction digits. - ISO 8601 week, ordinal and basic forms:
2024-W10-7,2024-070,20240310T073000Z. - RFC 2822 email dates:
Sun, 10 Mar 2024 07:30:00 +0000, including EST, PDT and other US zone names. - JavaScript Date strings:
Sun Mar 10 2024 02:30:00 GMT-0500 (Eastern Standard Time). - Apache and Nginx log dates:
10/Mar/2024:07:30:00 +0000. - Go and database output:
2024-03-10 02:30:00 -0500 EST,2024-03-10 07:30:00. - Written dates:
March 10, 2024 at 2:30 PM,10th of March 2024 14:30. - Numeric dates such as
03/10/2024, read month first or day first as chosen under Numeric dates. - A zone name after the date:
2024-03-10 14:30 America/New_York. - The words now, today, yesterday and tomorrow.
Abbreviations that mean more than one zone, such as IST, are rejected with a message instead of guessed. A weekday that does not match the date is noted, and the date numbers win.
Time zones and daylight saving time
A timestamp has no time zone. It names one moment, and every zone shows that moment with its own clock. 1710055800 is 07:30 in UTC, 03:30 in New York and 13:00 in India. Time zone changes how the date is written, never which moment it is. The offsets and daylight saving rules come from the time zone data built into your browser.
Turning a local date into a timestamp is harder, because daylight saving creates clock times that do not exist and clock times that happen twice. In New York, 02:30 on 10 March 2024 never happened, because clocks jumped from 02:00 to 03:00. The tool moves such a time forward past the gap and says so. On 3 November 2024, 01:30 happened twice. The tool uses the first one and tells you how to pick the other.
2024-11-03 01:30:00 (zone America/New_York) → 1730611800
2024-11-03 01:30:00 -0500 (offset given) → 1730615400The year 2038 problem and the range of dates
Older C programs and file formats keep time in a signed 32-bit integer. The largest value it can hold is 2147483647, which is 03:14:07 UTC on 19 January 2038. One second later the counter wraps around to a date in 1901. The tool flags every value past that limit, and before 13 December 1901, and the details panel shows whether the value fits.
2147483647 → 2038-01-19T03:14:07Z fits in 32 bits
2147483648 → 2038-01-19T03:14:08Z does not fitThe tool itself is not limited to 32 bits. It accepts any moment a JavaScript date can hold, from about 271,821 BC to AD 275,760, with nanosecond precision. Years outside 0000 to 9999 are written in the expanded ISO form, such as +010000-01-01T00:00:00Z, and dates are read back with or without the sign, so 10000-01-01 and 275760-09-13T00:00:00Z both work. Negative timestamps are dates before 1970.
Leap seconds and what Unix time leaves out
UTC has had 27 leap seconds added since 1972, each written as 23:59:60. Unix time ignores them: every day is exactly 86,400 seconds. So the leap second at the end of 2016 and the first second of 2017 share one timestamp. The tool reads 23:59:60 the way POSIX does, as the first second of the next minute, and adds a note.
2016-12-31T23:59:60Z → 1483228800
2017-01-01T00:00:00Z → 1483228800Because of this, subtracting two Unix timestamps gives the elapsed seconds without leap seconds. For almost all software that is what you want. For precise science or satellite timing, use a time scale such as TAI instead.
Logs, IDs and other epochs
Log files often hold raw epoch numbers in the middle of a line. Direction Auto and Find in text replace every 10, 13, 16 or 19 digit number that falls between 2001 and 2100 with a readable date and leave the rest of the line alone. Output set to Input and result keeps the original number next to the date.
1710055800 (2024-03-10T07:30:00Z) INFO server started on port 8080
[1710055861.482 (2024-03-10T07:31:01.482Z)] GET /api/orders 200 34ms
ts=1710055923000 (2024-03-10T07:32:03Z) level=warn msg="slow query" duration=1520msSome IDs carry their creation time. A MongoDB ObjectId keeps seconds in its first four bytes, UUID versions 1, 6 and 7 and ULIDs keep a time as well, so pasting one shows when it was made. A version 4 UUID is random and holds no time. Epoch also reads Apple Cocoa time (seconds from 2001), Windows FILETIME and LDAP values (100 nanosecond ticks from 1601), Chrome and WebKit time (microseconds from 1601) and Excel or Google Sheets serial dates.
507f1f77bcf86cd799439011 → 2012-10-17T21:13:27Z
018f3c2e-7b4a-7c3d-9e1f-2a3b4c5d6e7f → 2024-05-03T02:00:30.282Z
2024-03-10T07:30:00Z with Epoch Excel → 45361.3125
2024-03-10T07:30:00Z with Epoch Windows FILETIME → 133545294000000000To turn the results into a calendar file, the CSV to ICS converter builds events from a spreadsheet, and the ICS to CSV converter goes the other way. For repeating jobs, the cron expression generator shows when a schedule will run.
Get the current Unix timestamp in code
Each language has a one-line way to read the current time as a Unix timestamp and to turn one back into a date. Note the unit each one returns.
Math.floor(Date.now() / 1000);
new Date(1710055800 * 1000).toISOString();import time, datetime
int(time.time())
datetime.datetime.fromtimestamp(1710055800, datetime.timezone.utc).isoformat()date +%s
date -u -d @1710055800 +%Y-%m-%dT%H:%M:%SZSELECT EXTRACT(EPOCH FROM NOW())::bigint;
SELECT to_timestamp(1710055800) AT TIME ZONE 'UTC';The macOS date command uses date -u -r 1710055800 instead of -d @. In MySQL, use UNIX_TIMESTAMP() and FROM_UNIXTIME(1710055800), which show the result in the session time zone.
Limits and privacy
The tool converts up to 50,000 lines and 2 million characters at a time. Find in text only matches numbers between 2001 and 2100, so it does not turn phone numbers or order IDs into dates, but it also skips older timestamps; paste those on their own line instead. Browser locale output depends on your language settings, and Local uses the zone your device reports. Excel serial numbers below 61 differ by one day from Excel itself, because Excel treats 1900 as a leap year.
Conversion happens in your browser. Nothing you paste is uploaded or stored on a server.