Convert a Unix Timestamp to a Date in JavaScript
Convert a Unix timestamp to a Date in JavaScript with new Date(ts * 1000). Check your result with the live converter and avoid the seconds vs milliseconds trap.
Part of the free Unix Timestamp Converter. Runs in your browser — nothing is uploaded.
Convert a Unix Timestamp to a Date in JavaScript
JavaScript's Date constructor expects milliseconds. A Unix timestamp in seconds must be multiplied by 1000 first. Use the converter to verify the date you expect before wiring it into code.
Worked example: new Date(1700000000 * 1000)
Code
new Date(1700000000 * 1000).toISOString()
Result of toISOString()
2023-11-14T22:13:20.000Z
Practical tip
For display, prefer toLocaleString with an explicit timeZone option such as { timeZone: "UTC" } so output is the same on every machine.
How to use this Unix Timestamp
- 1Use the live tool above — it runs entirely in your browser and never uploads your data.
- 2Paste the sample from the worked example, or use your own input.
- 3Copy the result, then adapt the same steps in your editor, script, or pipeline.
Convert a Unix Timestamp to a Date in JavaScript FAQs
Why does my timestamp show 1970 in JavaScript?
You passed seconds where milliseconds were expected. new Date(1700000000) is January 1970. Multiply by 1000.
How do I convert a Date back to a timestamp?
Use Math.floor(date.getTime() / 1000) for seconds, or date.getTime() for milliseconds.
More Unix Timestamp pages
- Epoch to Date ConverterConvert an epoch or Unix timestamp to a readable date and time. Paste seconds or milliseconds and get UTC and local time instantly.
- Convert a Date to a Unix TimestampConvert a calendar date and time to a Unix timestamp in seconds. Enter a date, choose a timezone and copy the epoch value.
- Milliseconds Timestamp to DateConvert a 13-digit millisecond Unix timestamp to a readable date. Works for JavaScript Date.now() and Java System.currentTimeMillis() values.
- Current Unix TimestampGet the current Unix timestamp in seconds and milliseconds. See how to read epoch time now in JavaScript, Python, Bash and SQL.
- Convert Epoch to UTCConvert an epoch timestamp to a UTC date and time. See the ISO 8601 string and avoid local-timezone confusion when reading logs.
- What Date Is Unix Timestamp 1000000000?Unix timestamp 1000000000 is the "billennium": the moment epoch time reached one billion seconds. See the exact date and how to convert any timestamp.
- Year 2038 Problem and Timestamp 2147483647Timestamp 2147483647 is the largest 32-bit signed Unix time. Convert it to see the date and learn how to avoid the Year 2038 problem.
- Unix Timestamp to ISO 8601Convert a Unix timestamp to an ISO 8601 string like 2026-01-01T00:00:00Z. Ideal for APIs, JSON payloads and logging formats.
- Convert a Unix Timestamp in SQLConvert Unix timestamps to dates in MySQL with FROM_UNIXTIME and in PostgreSQL with to_timestamp. Verify the expected value with the converter.