JSONHack
Validator · Formatter · Base64
Date & Time Tool

Unix Timestamp Converter

📅Last updated:

Convert Unix epoch timestamps to human-readable dates and times, or convert a date back to a Unix timestamp. Supports both seconds and milliseconds. All conversions happen instantly in your browser.

Current timestamp: loading...

Timestamp → Human Date

Date → Timestamp

What is a Unix Timestamp?

A Unix timestamp (also called epoch time) is the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC — known as the Unix epoch. It is a simple, timezone-independent way to represent a specific point in time as a single integer. Unix timestamps are used extensively in programming, databases, APIs, log files, and JWT tokens.

Seconds vs Milliseconds

Seconds (10 digits)

Standard Unix timestamp. Example: 1700000000. Used in most Unix/Linux systems, JWT exp and iat claims, and POSIX APIs.

Milliseconds (13 digits)

JavaScript's Date.now() returns milliseconds. Example: 1700000000000. Used in JavaScript, Java, and many modern APIs.

Common Use Cases

Decoding a JWT with timestamps?

Use the JWT Decoder to inspect exp and iat claims with human-readable dates.

Open JWT Decoder →

Unix Timestamps in APIs and JSON

Unix timestamps appear constantly in modern software development. REST APIs frequently return timestamps as integers in JSON responses, JWT tokens use Unix timestamps for the exp (expiration) and iat (issued at) claims, database records store creation and update times as epoch values, and log files use timestamps for event ordering. Being able to quickly convert between a raw timestamp and a human-readable date is an essential developer skill.

How to Get the Current Unix Timestamp

Here is how to get the current Unix timestamp in the most popular programming languages:

// JavaScript
Math.floor(Date.now() / 1000)  // seconds
Date.now()                      // milliseconds

// Python
import time
int(time.time())               # seconds

// PHP
time()                         # seconds

// Java
System.currentTimeMillis() / 1000L  // seconds

// Go
time.Now().Unix()              // seconds

// SQL (PostgreSQL)
EXTRACT(EPOCH FROM NOW())::INT

Timestamp Formats Compared

Unix Timestamp (Seconds)

10-digit integer. Example: 1700000000. Standard in Unix/Linux, JWT tokens, POSIX APIs, and most backend systems.

Unix Timestamp (Milliseconds)

13-digit integer. Example: 1700000000000. Used in JavaScript Date.now(), Java, and many modern APIs.

ISO 8601

Human-readable string. Example: 2023-11-14T22:13:20Z. The recommended format for dates in JSON APIs and configuration files.

RFC 2822

Email date format. Example: Tue, 14 Nov 2023 22:13:20 +0000. Used in HTTP headers and email systems.

Common Timestamp Pitfalls

Related Tools