Unix Timestamp Converter

Unix Timestamp (seconds)
Unix Timestamp (milliseconds)
UTC Time
Local Time
Input unit for the timestamp
EventUnix Timestamp (s)Date
Unix Epoch Start0January 1, 1970 00:00:00 UTC
Y2K946684800January 1, 2000 00:00:00 UTC
Today (start of day)
Y2K38 Problem2147483647January 19, 2038 03:14:07 UTC
Year 21004102444800January 1, 2100 00:00:00 UTC

What is a Unix Timestamp?

A Unix timestamp is the number of seconds that have elapsed since January 1, 1970 at 00:00:00 UTC — a reference point known as the Unix Epoch. Because it is timezone-independent, Unix timestamps are ideal for storing and comparing times across different systems and regions. A timestamp of 0 represents exactly the epoch start, and negative values represent times before 1970.

Seconds vs Milliseconds

Traditional Unix timestamps count elapsed seconds and are typically 10 digits long (e.g. 1700000000). JavaScript's Date.now() and many modern APIs return milliseconds instead, producing 13-digit values (e.g. 1700000000000). To convert seconds to milliseconds, multiply by 1000. To convert milliseconds to seconds, divide by 1000 and floor the result.

Unix Timestamp vs ISO 8601

Unix timestamps are compact integers, making them efficient for storage, sorting, and arithmetic. ISO 8601 (e.g. 2024-03-15T09:30:00.000Z) is a human-readable string format that's self-describing and unambiguous. Use timestamps internally in databases and APIs; use ISO 8601 in logs, user interfaces, and anywhere a human might read the value.

How to Tell Seconds from Milliseconds at a Glance

Digit count is a reliable heuristic for any timestamp in the modern era, and this tool applies it automatically.

DigitsUnitExampleInterpreted as
10Seconds170000000014 Nov 2023
13Milliseconds170000000000014 Nov 2023
16Microseconds170000000000000014 Nov 2023
19Nanoseconds170000000000000000014 Nov 2023

Getting the unit wrong produces errors that are absurd rather than subtle, which is the one mercy here. Read a millisecond value as seconds and you land in the year 55,844. Read seconds as milliseconds and everything collapses into January 1970 — the classic "all my records show 1970" bug, and a reliable sign that a value was divided by 1000 one time too many.

Timestamps in Common Languages

The unit each language returns by default is the usual source of confusion at a service boundary.

LanguageCurrent timestampReturns
JavaScriptDate.now()Milliseconds
Pythontime.time()Seconds (float)
PHPtime()Seconds
Gotime.Now().Unix()Seconds
JavaSystem.currentTimeMillis()Milliseconds
RubyTime.now.to_iSeconds
RustSystemTime::now()Duration since epoch
PostgreSQLEXTRACT(EPOCH FROM NOW())Seconds (float)
MySQLUNIX_TIMESTAMP()Seconds
Shelldate +%sSeconds

When a JavaScript front end sends Date.now() to a Python backend that assumes time.time(), every date lands roughly 50,000 years in the future. Normalising on one unit — seconds is the more common convention for APIs — at the boundary avoids the whole category. If the API in question returns those timestamps inside a JSON body, our YAML and JSON converter is handy for reformatting the payload while you inspect it.

Timestamp Pitfalls Worth Knowing

The Year 2038 problem. A signed 32-bit integer overflows at 03:14:07 UTC on 19 January 2038, wrapping to 1901. Any system still storing timestamps in a 32-bit column will break. Use 64-bit integers, which are good for roughly 292 billion years.
Unix time ignores leap seconds. The epoch count assumes every day is exactly 86,400 seconds, which is not true of UTC. A Unix timestamp is therefore not a true count of elapsed SI seconds since 1970. For everyday application work this is irrelevant; for high-precision timing, it is the reason a leap second appears as a repeated or stretched value rather than a distinct one.
A timestamp has no timezone. This is a feature, not an omission — an epoch value is an absolute instant. The timezone only enters when you format it for a human. Bugs arise when code stores a local wall-clock time as if it were an epoch value; you can no longer tell which instant was meant. Store UTC, convert on display.
Negative timestamps are valid. Values before 1970 are negative — -86400 is 31 December 1969. Plenty of libraries and database drivers mishandle them, so historical dates deserve a test case.

Choosing How to Store Time

Three sensible options, each with a different trade-off:

Whichever you pick, the durable rule is to store instants in UTC and apply the user's timezone only at the point of display. Storing local time is the root cause of the annual crop of daylight-saving bugs, where an hour either repeats or never happens. If you are writing the queries that read those columns, our SQL formatter makes the date arithmetic easier to read.

Debugging timestamps across regions? Log platforms such as Better Stack Logs normalise timestamps from every service to a single timezone, which turns "which event actually happened first" into something you can see rather than calculate. These are affiliate links — they cost you nothing and help keep these tools free.

Frequently Asked Questions

Why does my date show as 1 January 1970?
The value reaching the formatter is 0, null, or an undefined variable coerced to zero. It usually means a field was never populated, or that a millisecond value was divided by 1000 twice.
How do I convert milliseconds to seconds?
Divide by 1000 and floor the result — Math.floor(ms / 1000). Flooring rather than rounding keeps you from landing a moment in the future.
What timezone does this tool use?
It shows both UTC and your browser's local timezone, so you can read whichever you need without a second conversion step.
Can I convert a date back into a timestamp?
Yes — the converter runs in both directions. Enter a date and time and it returns the corresponding epoch value in both seconds and milliseconds.
Is a Unix timestamp the same as epoch time?
Yes. "Unix time", "epoch time", and "POSIX time" all name the same thing: seconds elapsed since 1 January 1970 UTC.