Convert Unix timestamp to date and back
Timestamp → Date
Date → Timestamp
Code examples
Convert Unix timestamp to a readable date and back.
Unix timestamp is the number of seconds elapsed since January 1, 1970 (UTC). This format is widely used in APIs, logs, and databases.
Results are shown in UTC, local time, and ISO 8601 format.
Unix Timestamp Converter Online — with Code Examples
Unix timestamp (POSIX time, Epoch time) is the number of seconds since January 1, 1970 00:00:00 UTC. It is a universal way to store time, independent of timezone, date format, or locale. Our converter translates timestamps to dates and back, shows current time live, and provides code examples in 12 languages.
What Is Unix Timestamp and Epoch
Epoch is the starting point: January 1, 1970, 00:00:00 UTC. All dates before have negative timestamps.
Timestamp Code Examples
| Language | Current timestamp | Timestamp → Date |
|---|---|---|
| JavaScript | Math.floor(Date.now()/1000) | new Date(ts * 1000) |
| Python | time.time() | datetime.fromtimestamp(ts) |
| PHP | time() | date('Y-m-d', $ts) |
| Go | time.Now().Unix() | time.Unix(ts, 0) |
| SQL | UNIX_TIMESTAMP() | FROM_UNIXTIME(ts) |
Year 2038 Problem
32-bit systems store timestamps as signed int32, max value 2,147,483,647 = January 19, 2038, 03:14:07 UTC. After this, the number overflows. Solution: use 64-bit integers. Most modern systems already do.
Seconds vs Milliseconds
Unix timestamp is traditionally in seconds (10 digits). JavaScript and Java return milliseconds (13 digits). Our converter auto-detects the format.
Frequently Asked Questions
Why use timestamp instead of a date string?
Timestamps are timezone-independent, format-agnostic, and easy to sort and compute with.
How to convert a date to timestamp?
Enter a date in our converter. In code: JS — new Date('2025-01-01').getTime()/1000, Python — datetime(2025,1,1).timestamp().
What is "relative time"?
A human-readable representation: "5 minutes ago", "in 3 hours". Our converter shows relative time for each converted timestamp.
Does timestamp account for leap seconds?
No. Unix time treats every day as exactly 86,400 seconds.
For cron expressions use the Cron generator, for data formatting — JSON formatter.
Useful articles
WCAG Color Contrast: Website Accessibility Guide
A complete guide to color contrast: WCAG 2.1 standards, AA and AAA levels, calculation formula, practical examples of good and bad contrast, and how to fix accessibility issues.
CSS Border Radius: Rounding Element Corners
How to use border-radius: syntax, shorthand notation, elliptical corners. Online border-radius generator.