Tech Help
Unix Timestamp to Date: Seconds, Milliseconds and UTC Explained
Convert a Unix timestamp to a date. See seconds vs milliseconds, UTC vs local time, ISO 8601, and how to convert a date back to epoch time.
A Unix timestamp represents time relative to the Unix epoch: 1970-01-01 00:00:00 UTC. It is commonly stored as seconds since the epoch or as milliseconds since the epoch.
To convert correctly, you first need to know which unit you have. 1720000000 seconds is 2024-07-03 09:46:40 UTC. 1720000000000 milliseconds is the same instant.
The timestamp identifies an instant. UTC, local time, or an IANA zone only changes how that instant is displayed.
This is a conversion guide: timestamp to date, date to timestamp, UTC vs local, and ISO 8601. If a value unexpectedly becomes a 1970 date, that is usually a seconds/milliseconds mismatch—see Unix Timestamp Seconds vs Milliseconds: Why Your Date Shows 1970.
What Is a Unix Timestamp?
Unix timestamp, Unix time, and epoch time commonly mean elapsed time since 1970-01-01 00:00:00 UTC. The number is not a formatted date string with a timezone label. The same instant can display as different clock times in UTC, New York, Tokyo, or Seoul. Unix timestamps are not always seconds—milliseconds are common in practice.
What Is the Unix Epoch?
The Unix epoch is 1970-01-01 00:00:00 UTC. Timestamp 0 is that instant. A positive timestamp is after the epoch. Some systems allow a negative timestamp for a time before the epoch, but language and date-range support vary.
Is My Timestamp in Seconds or Milliseconds?
1720000000 is seconds; 1720000000000 is milliseconds; they are the same instant. A practical clue: about 10 digits often means seconds, about 13 digits often means milliseconds. Digit count is only a heuristic. Past or future dates, other units, or a custom epoch can look different. Date & Time Converter can convert with seconds, milliseconds, or auto (≤10 digits as seconds, ≥13 as milliseconds)—choose the unit when you know it.
Why Does the Wrong Unit Produce the Wrong Date?
JavaScript Date expects milliseconds. Passing 1720000000 as if it were milliseconds yields 1970-01-20 21:46:40 UTC. Treating milliseconds as seconds, or the reverse, lands on a very different date. For the 1970 troubleshooting path, see Unix Timestamp Seconds vs Milliseconds: Why Your Date Shows 1970.
new Date(1720000000);
// 1970-01-20T21:46:40.000Z
How to Convert a Unix Timestamp in Seconds
Multiply seconds by 1000 to get milliseconds. JavaScript Date is millisecond-based, so use new Date(timestamp * 1000).
const timestamp = 1720000000;
const date = new Date(timestamp * 1000);
date.toISOString();
// 2024-07-03T09:46:40.000Z
How to Convert a Millisecond Timestamp
Pass milliseconds to Date directly. Do not multiply a millisecond timestamp by 1000 again.
const timestamp = 1720000000000;
const date = new Date(timestamp);
date.toISOString();
// 2024-07-03T09:46:40.000Z
Why Does the Same Timestamp Show a Different Time?
A Unix timestamp is one instant. Displaying it in UTC, local time, or a chosen IANA zone changes the clock face. For 1720000000000, UTC is 2024-07-03 09:46:40. America/New_York on that date is 2024-07-03 05:46:40 (EDT). Asia/Seoul is 2024-07-03 18:46:40 (UTC+9). Those New York and Seoul values come from Intl, not from a fixed offset slogan.
Does a Unix Timestamp Contain a Time Zone?
No. It does not store America/New_York or Asia/Seoul. The timestamp identifies an instant. A timezone is applied when you format that instant as a human-readable date and time. The epoch is defined relative to UTC; the number itself is not “a UTC timezone field.”
Unix Timestamp vs ISO 8601
1720000000 and 2024-07-03T09:46:40Z can represent the same instant. Unix is a numeric elapsed-time value. ISO 8601 is a readable date-time string and may end with Z (UTC) or a numeric offset. Z means UTC; it is sometimes called Zulu. They are not the same format.
How Do You Get the Current Unix Timestamp?
In JavaScript, Date.now() is milliseconds. Math.floor(Date.now() / 1000) is seconds. Do not hardcode “now” in an article; it moves.
Date.now();
Math.floor(Date.now() / 1000);
Can You Convert a Date Back to a Unix Timestamp?
Yes. From an explicit UTC ISO string, getTime() returns milliseconds; divide by 1000 and floor for seconds.
const date = new Date("2024-07-03T09:46:40Z");
date.getTime();
// 1720000000000
Math.floor(date.getTime() / 1000);
// 1720000000
Be Careful With Ambiguous Date Formats
03/07/2024 can mean 7 March or 3 July depending on locale. Prefer an ISO-style date and time with a timezone or offset. Date & Time Converter rejects ambiguous numeric dates such as 01/02/2026 and asks for a date picker or an ISO-style value.
What About Daylight Saving Time?
A Unix timestamp does not store a DST flag. Local display applies the zone’s rules. America/New_York uses different offsets in winter and summer, so “New York is UTC-5” is not always true.
Do Unix Timestamps Include Leap Seconds?
Typical POSIX/Unix time does not count leap seconds as extra SI seconds on a continuous scale. Platforms can differ. For everyday conversion you can ignore this detail.
Common Unix Timestamp Conversion Mistakes
These mix-ups produce the wrong date or the wrong clock face:
Seconds treated as milliseconds
A modern seconds value then lands near 1970 in JavaScript Date.
Milliseconds treated as seconds
The date jumps far into the future.
Treating 10 or 13 digits as a law
Digit count is a clue, not a guarantee.
Confusing UTC with local time
The instant is the same; the displayed clock may differ.
Assuming a timezone is inside the number
IANA names are applied at display time, not stored in the timestamp.
Ambiguous dates, DST slogans, or extra ×1000
Use ISO-style input. Do not multiply a millisecond timestamp again.
Verified UTC Examples
These UTC clock times were computed, not guessed:
| Input | Unit | UTC |
|---|---|---|
| 0 | seconds | 1970-01-01 00:00:00 |
| 1720000000 | seconds | 2024-07-03 09:46:40 |
| 1720000000000 | milliseconds | 2024-07-03 09:46:40 |
| 1720000000 | milliseconds | 1970-01-20 21:46:40 |
A Simple Conversion Decision Guide
If the source names the unit, use it. If not, digit count is a clue—then check that the date looks plausible. Convert seconds to milliseconds when the API needs ms. Pick UTC, local, or an IANA zone for display. ISO 8601 is useful for storage and exchange.
- Have a Unix timestamp
- Unit specified? Use it; else check magnitude
- Seconds? ×1000 if the API needs milliseconds
- Milliseconds? Use directly in a ms-based API
- Display as UTC, local, or an IANA zone
- Need a string? ISO 8601 may fit
The timestamp identifies a point in time. UTC, local time, or a timezone only decides how that instant is shown to a person.
Convert Unix Timestamps in Your Browser
NEXNARA Date & Time Converter converts Unix seconds and milliseconds, shows UTC, local time, and ISO 8601, and converts among IANA time zones.
Unix mode supports seconds, milliseconds, auto unit, current time, and date-to-timestamp. Time zone mode searches IANA names, uses the browser zone, and applies DST-aware Intl offsets. Format mode has locale-readable output, 12/24-hour display, and an ambiguous-date guard. Date difference is a separate mode.
Conversion uses the browser Date and Intl APIs. Values outside what Date can represent are rejected. Auto unit does not guess 11–12 digit values; pick seconds or milliseconds.
Date and timestamp conversion itself happens in your browser. Inputs are not sent to a NEXNARA server for conversion. Ads and other site features still use the network.
Paste a timestamp in Date & Time Converter and compare UTC, local time, and ISO 8601 before you pick a unit.
FAQ
How do I convert a Unix timestamp to a date?
Know the unit. For seconds in JavaScript, use new Date(n * 1000). For milliseconds, use new Date(n). Then format as UTC, local, or a zone.
Is Unix timestamp in seconds or milliseconds?
Either. About 10 digits often means seconds and about 13 often means milliseconds, but that is a heuristic, not a rule.
Why does my timestamp show 1970?
Usually a seconds value was read as milliseconds. See Unix Timestamp Seconds vs Milliseconds: Why Your Date Shows 1970.
Is Unix timestamp always UTC?
The epoch is defined relative to UTC, and the number identifies an instant. Display timezone is separate. It is not a stored “UTC timezone field.”
Does a Unix timestamp contain a timezone?
No. It does not carry an IANA identifier. Timezone is applied when you format the instant.
How do I convert a date to Unix timestamp?
From a UTC ISO string, date.getTime() is milliseconds; Math.floor(date.getTime() / 1000) is seconds.