Unix Timestamp Converter — Epoch to Date and Back
Convert a Unix timestamp (epoch time) into a readable UTC date, or turn a date into a timestamp. Works with seconds and milliseconds, shows the current timestamp live and runs entirely in your browser.
Related tools
- CSV to JSON Converter Convert CSV to a JSON array of objects, with comma, semicolon or tab delimiter and the header row as keys.
- JSON to YAML Converter Convert JSON to clean YAML for Kubernetes, docker-compose or GitHub Actions, and YAML back to JSON.
- XML to JSON Converter Convert XML to JSON with attributes, repeated elements as arrays and CDATA, ideal for SOAP responses, RSS feeds and sitemaps.
- Data Converter Convert between JSON, XML, YAML and CSV formats and Unix timestamps. Format conversion with clear error messages and customizable output formatting.
Features
- Convert Unix timestamps to readable dates (UTC)
- Convert dates back to Unix timestamps
- Seconds and milliseconds supported
- Current Unix timestamp, updated every second
- Auto-convert while you type
- Runs entirely in your browser, nothing is uploaded
What Is a Unix Timestamp?
A Unix timestamp (also called epoch time or POSIX time) counts the seconds that have passed since 1 January 1970, 00:00:00 UTC, the so-called Unix epoch. The timestamp 1700000000, for example, is 2023-11-14 22:13:20 UTC.
Because it is a single number without a time zone, a timestamp means the same moment everywhere in the world. That makes it the usual way to store and exchange points in time in databases, log files, APIs and JWT tokens (iat, exp). Only when a timestamp is displayed does it get converted to a local time.
Seconds or Milliseconds?
Not every system counts in seconds. The number of digits usually tells you which unit you have:
- 10 digits, e.g.
1700000000: seconds. Used by Unix, PHPtime(), Pythontime.time(), MySQL and JWT. - 13 digits, e.g.
1700000000000: milliseconds. Used by JavaScriptDate.now(), JavaSystem.currentTimeMillis()and many JSON APIs.
Choose the matching unit above the input. If you pick the wrong one, the result is off by a factor of 1000: 1700000000 read as milliseconds becomes 20 January 1970.
Getting the Current Timestamp in Code
The current Unix timestamp in seconds, in the languages you are most likely to need:
// JavaScript (Node.js, browser)
Math.floor(Date.now() / 1000)
# Python
import time
int(time.time())
// PHP
time();
# Bash / Linux / macOS
date +%s
-- MySQL
SELECT UNIX_TIMESTAMP();
-- PostgreSQL
SELECT EXTRACT(EPOCH FROM now())::bigint; Common Pitfalls
- Time zones: a timestamp is always UTC. This tool shows results in UTC and reads dates without a time zone as UTC. For local time add an offset, e.g.
2023-11-14T23:13:20+01:00. - Seconds vs. milliseconds: a date in 1970 or tens of thousands of years in the future almost always means the wrong unit.
- The year 2038 problem: systems that store timestamps as signed 32-bit integers overflow after
2147483647, which is 19 January 2038, 03:14:07 UTC. Use 64-bit integers for new code. - Leap seconds: Unix time ignores them; every day has exactly 86,400 seconds. For everyday use this makes no difference.
Useful Resources