How to Convert a Unix Timestamp to a Date (and Back)

APIs, logs and databases often store time as a single number like 1767225600. That’s a Unix timestamp – seconds since 1 January 1970 UTC.

๐Ÿ•Free Unix Timestamp Converter
Epoch time to date and date to epoch.
Open tool →

Seconds or milliseconds?

10 digits is usually seconds (1767225600); 13 digits is milliseconds (1767225600000), used by JavaScript and many APIs. The Unix Timestamp Converter detects both automatically.

Convert in code

JavaScript: new Date(1767225600 * 1000).toISOString(). Python: datetime.fromtimestamp(1767225600, tz=timezone.utc). SQL (MySQL): FROM_UNIXTIME(1767225600). Excel: =(A1/86400)+DATE(1970,1,1) then format as date.

Time zones

A timestamp is always UTC. Convert it to local time only when displaying it – store and compare in UTC.

The 2038 problem

32-bit signed timestamps overflow on 19 January 2038. Modern 64-bit systems are fine, but old embedded devices and databases may not be.

Frequently asked questions

What is epoch time?

Another name for Unix time – seconds since 1970-01-01 00:00:00 UTC.

Can timestamps be negative?

Yes, for dates before 1970.

Do timestamps include leap seconds?

No, Unix time ignores them.

๐Ÿ•Free Unix Timestamp Converter
Epoch time to date and date to epoch.
Open tool →

More guides