Unix Timestamp Converter
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.
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
- Checking JWT token expiry (
expclaim is a Unix timestamp in seconds) - Reading timestamps from API responses and log files
- Calculating time differences between two events
- Setting expiry times for cookies, sessions, and cache headers
- Debugging date-related bugs in applications
Use the JWT Decoder to inspect exp and iat claims with human-readable dates.
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
- Seconds vs milliseconds confusion — always check whether an API returns seconds (10 digits) or milliseconds (13 digits). Dividing by 1000 converts ms to seconds.
- Timezone issues — Unix timestamps are always UTC. Convert to local time only for display purposes, never for storage.
- Year 2038 problem — 32-bit signed integers overflow on January 19, 2038. Modern systems use 64-bit integers to avoid this.
- Daylight saving time — Unix timestamps are not affected by DST since they are always UTC-based.
Related Tools
- JWT Decoder — decode JWT tokens and see
expandiatas human-readable dates - Hash Generator — generate hashes from timestamps or other data
- Number Base Converter — convert timestamps between decimal, hex, and binary
- JSON Formatter — format API responses containing timestamps
- JSON Diff — compare API responses with different timestamp values