🔒 Processed locally in your browser — no data uploaded
← Back to Home

Timestamp Converter

Timestamp to date
Date to timestamp
Current time
Result

What the Timestamp Converter does

This converter moves between Unix epoch time and readable dates in both directions. Paste a number to see the date it points at, or pick a day and time to get the epoch value back. A third button fills both fields with the present moment in seconds and milliseconds, ready for a log line or a default value in a form you can copy.

Unit detection is automatic: inputs of ten digits or fewer are read as seconds, longer ones as milliseconds. Every result also prints the same instant as a UTC timestamp in ISO 8601 form alongside the raw millisecond value, so you can copy the shape your API expects. The arithmetic uses the browser's built-in date handling, and values stay in the page.

How to use it

  1. Paste a timestamp numberType or paste the value into the first field. Ten-digit values are read as seconds and longer ones as milliseconds, so both the 1700000000 and the thirteen-digit milliseconds form work in the same box.
  2. Convert a date forwardOpen the date and time picker in the second row, choose the moment you want, then press that row's Convert button. The result prints the epoch value in seconds on the first line and in milliseconds on the second.
  3. Grab the current timeOne click fills the timestamp field with the current second, sets the picker to now, and prints both epoch forms. Handy for comparing a server clock or a log entry against your own machine.
  4. Read the UTC lineUnderneath the result, the tool prints the same instant as a UTC ISO string and as a millisecond count. That line is the unambiguous one when you need to compare a value against server logs.

Options and formats

Seconds to dateThe main direction. A value of ten digits or fewer is treated as seconds since the epoch, and the readable result shows the local date and time down to the second.
Milliseconds to dateLonger numbers are read as milliseconds, which is what JavaScript, Java and many logging libraries emit by default. The division by a thousand happens inside the page.
Date to epochThe picker supplies a local date and time. The result prints the second value, rounded down, and the exact millisecond value, both counted from the epoch.
Current-time shortcutA single button that fills the input field, sets the picker, and prints both epoch forms for right now. It removes the need to copy a number between the two halves of the page.
ClearEmpties the input field, the picker and the result panel so the next conversion starts blank. Reloading the page refills both fields with the current time.

Things to watch out for

Digit count decides the unitThe page judges seconds against milliseconds by counting characters, not by inspecting the magnitude. A ten-digit millisecond value, which only occurs for dates in early 1970, would be read as seconds, so pad or trim deliberately if you are unsure.
Fractions are truncated, not roundedA value like 1700000000.5 is twelve characters long, so it is taken as milliseconds and lands in January 1970. Strip the decimal part before converting.
The picker follows your browserThe date field hands over a plain local string, and how that string is parsed comes from the browser rather than this page. A result out by a whole number of hours points at your time zone setting.
The formatted date uses a fixed zoneThe readable line is rendered for Asia/Shanghai time, eight hours ahead of UTC, no matter where you are sitting. That makes it stable as a reference but wrong as a reading of your own clock, so cross-check against the UTC line before using it.

Frequently asked questions

What exactly is a Unix timestamp?

A count of seconds since midnight on 1 January 1970 in UTC, with leap seconds ignored. The integer itself belongs to no time zone; the calendar date it maps to depends on the zone you display it in. Two people in different countries read the same number for the same instant.

Should I use seconds or milliseconds?

It depends on the consumer. Most HTTP headers and database columns use seconds, while JavaScript, Java's clock and many log exporters use milliseconds. This page reads ten digits or fewer as seconds and gives you both forms when you convert a date forward, so you can match either convention.

Why is my result eight hours ahead?

The readable line is generated for Asia/Shanghai time, so on a machine set to a different offset it will not agree with your wall clock. The UTC line printed underneath is the trustworthy one, so paste it into a converter that shows your own zone.

Can I convert dates before 1970?

Yes. Epoch seconds are signed, so a negative value such as minus 86400 maps to the last day of 1969. The same character-count rule applies, so a negative value of ten characters or fewer is multiplied by a thousand and stays a second value rather than becoming milliseconds.

What is the ISO string in the second line?

It is the same instant written in ISO 8601 form with a trailing Z, which marks it as UTC. Databases, log viewers and spreadsheets parse that shape without needing to know your local offset, which is why it is the safest value to copy between systems.

Does it work offline, and can it convert a list?

The conversion is a few lines of built-in date arithmetic, so the page keeps working without a network connection once loaded. There is no batch mode: values are handled one at a time, so for a long column use a spreadsheet formula or a script instead.