Unix Timestamp and Date Converter
Two-way conversion between Unix timestamps and dates, with automatic seconds / milliseconds detection, UTC, ISO 8601 and local readings, plus batch conversion and date arithmetic.
Reading logs, checking what an API actually returned, working out when a token expires — all of it comes down to converting between epoch time and a human date, usually in your head. Seconds or milliseconds, which day a number lands on, what an offset does across a month boundary: too many chances to be an hour off. This page puts the conversions, the arithmetic and the batch case in one place, and reports every result in UTC, ISO 8601 and local time.
All calculations use the browser's own date handling and nothing you type is uploaded, so log lines from production are fine to paste. One thing to keep in mind: local time depends on the time zone your machine is set to. When you are comparing notes across a distributed team, use the UTC or ISO 8601 reading — those are unambiguous.
Seconds or milliseconds, detected automatically
In Auto mode the value's magnitude decides the unit: an absolute value below 1e11, roughly ten digits, is treated as seconds and multiplied by 1000, while anything larger is treated as milliseconds. A second-level and a millisecond-level timestamp of the same instant therefore produce the same result. When the digit count sits near the boundary, lock the unit to Seconds or Milliseconds explicitly. The failure mode is easy to recognise: a millisecond value read as seconds lands near 1970, and a seconds value read as milliseconds lands tens of thousands of years out. If the year looks absurd, check the unit first. A live counter at the top of the page shows the current seconds and milliseconds values; it can be paused, recalibrated and copied value by value.
Readings across time zones
Every conversion is reported several ways at once. Local time uses your operating system's time zone, with daylight saving handled by the browser for the date in question. A China Standard Time reading is included as a fixed UTC+8 value, the same no matter where the machine is. UTC is printed in the standard GMT format, and ISO 8601 gives the full unambiguous instant for query parameters and database columns. Relative time ('3 hours ago') is handy when scanning logs, and the weekday, ISO week number and day of the year are there for aligning schedules and checking dates. For anything cross-border, compare the UTC or ISO 8601 values rather than the local ones.
Date input, arithmetic and batch conversion
The date-to-timestamp field accepts the YYYY-MM-DD HH:mm:ss shape, the same with slashes instead of dashes, and a raw number; anything else falls back to the browser's date parser, which is why the recommended shape is the safe one. One subtlety worth knowing: a date-only value such as 2026-09-26 is interpreted as UTC midnight, while a date and time without a zone is read as local time, and mixing the two is a classic source of off-by-hours bugs. The offset calculator adds or subtracts days, hours, minutes or seconds (minimum 1) from any base time, using local calendar arithmetic so month ends and daylight saving transitions are handled for you; it is the quick way to work out token lifetimes and cache expiry. Batch mode takes one value per line and accepts a mix: numeric lines are converted to date-times, date lines produce both the second and millisecond timestamps, and lines that cannot be parsed are marked as invalid format without disturbing the rest. A cheat sheet at the bottom has copy-ready snippets for JavaScript, Python, Java, Go, PHP and MySQL.
Frequently asked questions
- How do I tell whether a timestamp is in seconds or milliseconds?
- Count the digits first: ten digits is seconds, thirteen is milliseconds. This tool's Auto mode uses the same idea, treating anything below 1e11 as seconds. If the result looks wrong, check the unit: milliseconds parsed as seconds give a date around 1970, and seconds parsed as milliseconds give a year far in the future. Locking the unit removes the guesswork when a value sits near the boundary.
- Which time zone are the results in?
- All of them at once: local time in the machine's zone, a fixed UTC+8 reading, and UTC / ISO 8601. Local time changes with the machine's settings, so it is the wrong thing to quote to a colleague in another region — use the ISO 8601 value, which carries an explicit zone, or the UTC string.
- Can I convert a batch of values, and can timestamps and dates be mixed?
- Yes, one value per line. Each line is judged on its own: a number is converted to a date and time, a date is converted to both second and millisecond timestamps, and a line that cannot be parsed is flagged as invalid format without affecting the others. That covers the usual case of pasting a column of times out of a log file.
- What date formats does the date input accept?
- YYYY-MM-DD HH:mm:ss works, and so does the same with slashes. A date with no time is accepted but parsed as UTC midnight, not local midnight, so add a time if that matters. Other layouts are passed to the browser's own date parser and may be read differently in different browsers, so stick to the documented shape rather than a locale-specific format.