DeveloperApril 2026 ยท 5 min read

How to Convert Unix Timestamps to Human-Readable Dates

A Unix timestamp is the number of seconds (or milliseconds) since January 1, 1970 00:00:00 UTC โ€” called the Unix epoch. APIs, databases, and log files use timestamps because they're unambiguous (no timezone confusion), compact (a single number), and easy to compare mathematically. Converting them to human-readable dates is something developers do daily.

๐Ÿ•
Try the Timestamp Converter
Free, no signup
โ†’
DG
Derek Giordano
Designer & Developer
In this guide
01Seconds vs Milliseconds02Converting in JavaScript03Timezone Handling04Quick Reference
โšก Key Takeaways
  • Convert Unix timestamps to dates and dates to timestamps.
  • Covers seconds vs milliseconds.
  • Covers converting in javascript.
  • Covers timezone handling.
  • Covers quick reference.

Seconds vs Milliseconds

Unix timestamps come in two common formats: seconds since epoch (10 digits, like 1713168000) and milliseconds since epoch (13 digits, like 1713168000000). JavaScript's Date.now() returns milliseconds. Most Unix tools and APIs use seconds. The difference matters โ€” if you pass milliseconds to a function expecting seconds, you'll get a date in the year 56000. Check the digit count: 10 digits = seconds, 13 digits = milliseconds.

Converting in JavaScript

Seconds to date:

๐Ÿ’ก Tip
Use 3+ color stops instead of 2 to avoid the muddy gray band that appears in the center of complementary-color gradients.

new Date(1713168000 * 1000).toISOString();

// '2024-04-15T08:00:00.000Z'

Date to seconds:

Math.floor(Date.now() / 1000);

// current timestamp in seconds

For formatted output: new Date(ts * 1000).toLocaleString('en-US', {timeZone: 'America/New_York'}) returns a locale-formatted string in a specific timezone.

Timezone Handling

Unix timestamps are always UTC โ€” they represent a single moment in time regardless of timezone. The timezone only matters when displaying the date to a user. Always store and transmit timestamps in UTC (seconds since epoch). Convert to local time only at the display layer. The Timestamp Converter tool shows the converted date in both UTC and your local timezone, making it easy to verify API timestamps and debug timezone issues.

โš  Warning
CSS gradients used as backgrounds cannot be animated with standard transitions. Use background-size animation or @property registered custom properties instead.

Quick Reference

January 1, 2020 00:00:00 UTC = 1577836800. January 1, 2025 00:00:00 UTC = 1735689600. January 1, 2030 00:00:00 UTC = 1893456000. The 'Year 2038 problem' affects systems that store timestamps as 32-bit signed integers โ€” they overflow on January 19, 2038 at 03:14:07 UTC. Most modern systems use 64-bit timestamps.

Frequently Asked Questions

What is a Unix timestamp?+
A Unix timestamp is the number of seconds since January 1, 1970 00:00:00 UTC (the Unix epoch). It represents a single moment in time as a simple number, independent of timezone.
How do I convert a Unix timestamp to a date?+
In JavaScript: new Date(timestamp * 1000) (multiply by 1000 because JS uses milliseconds). In Python: datetime.fromtimestamp(timestamp). Or paste it into the Timestamp Converter for instant results.
Why do some timestamps have 10 digits and others have 13?+
10-digit timestamps are in seconds since epoch. 13-digit timestamps are in milliseconds. JavaScript's Date.now() returns milliseconds; most APIs and Unix tools use seconds.
Try it yourself

Use the Timestamp Converter โ€” free, no signup required.

โšก Open Timestamp Converter
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.