CoShareX Logo
HomeBlogUtilitiesHow to Convert Unix Timestamps to Human-Readable Dates
Utilities

How to Convert Unix Timestamps to Human-Readable Dates

Published 2026-08-20
4 min read
By CoShareX

A Unix timestamp, or epoch time, represents the number of seconds (or milliseconds) that have elapsed since January 1, 1970 (UTC).

How to Convert Unix Timestamps in JavaScript

To parse a Unix timestamp in JavaScript, you create a new Date object:

1. From Seconds (10-digit epoch):

Multiply by 1000 since JavaScript dates work in milliseconds:

javascript
1
2
3
const seconds = 1787321000;
const date = new Date(seconds * 1000);
console.log(date.toISOString());
Featured Tool

Unix Timestamp Converter

Convert Unix timestamps to human dates and parse date strings into epoch seconds or milliseconds online with automatic local and UTC timezone detection.

2. From Milliseconds (13-digit epoch):

Pass directly into the Date constructor:

javascript
1
2
3
const ms = 1787321000000;
const date = new Date(ms);
console.log(date.toLocaleString());