Unix Timestamp Converter

Convert Unix epoch time to a readable date and back. Works in seconds or milliseconds, shows UTC and your local time, and runs entirely in your browser.

Current Unix timestamp

Seconds
…
Milliseconds
…

Timestamp to date

Seconds (10 digits) or milliseconds (13 digits). Negative values are before 1970.

Interpreted as
seconds
UTC
2023-11-14 22:13:20 UTC
Local time
2023-11-14 22:13:20 (UTC+00:00)
ISO 8601
2023-11-14T22:13:20.000Z
Relative
3 years ago

Date to timestamp

Formats: 2026-11-19 14:30:00, 2026-11-19, or ISO 8601 such as 2026-11-19T14:30:00Z or …+02:00.

Seconds
1700000000
Milliseconds
1700000000000
UTC
2023-11-14 22:13:20 UTC
Local time
2023-11-14 22:13:20 (UTC+00:00)

How to use the Unix timestamp converter

  1. To read a timestamp from a log, API response or database, paste it into Timestamp to date. The unit is detected from its size.
  2. To create a timestamp, type a date in Date to timestamp and choose whether it is UTC or your local time.
  3. Copy the seconds or milliseconds value into your code, query or config.
  4. Working with a JWT? Its exp and iat claims are timestamps in seconds; decode the token with the JWT Decoder and paste the values here. Time-ordered IDs? See the UUID generator (v7 embeds a millisecond timestamp).

Worked example

The timestamp 1700000000 has 10 digits, so it is in seconds. It is 1,700,000,000 seconds after the epoch, which is Tuesday 14 November 2023, 22:13:20 UTC. In New York (UTC−5 in November) that same instant reads 17:13:20, and in Athens (UTC+2) it reads 00:13:20 on 15 November, but the timestamp is the same everywhere.

The same moment in milliseconds is 1700000000000 (13 digits). A very common bug is passing milliseconds to something that expects seconds: the date lands tens of thousands of years in the future. Multiply or divide by 1,000 to convert.

seconds      = milliseconds ÷ 1000
milliseconds = seconds × 1000
days since epoch = seconds ÷ 86,400

Get the current Unix time in code

JavaScript

Math.floor(Date.now() / 1000)   // seconds
Date.now()                      // milliseconds
new Date(1700000000 * 1000)     // timestamp -> Date

Python

import time, datetime
int(time.time())                                              # seconds
datetime.datetime.fromtimestamp(1700000000, datetime.timezone.utc)  # timestamp -> UTC datetime

PHP

time();                      // seconds
date('c', 1700000000);       // timestamp -> ISO 8601
strtotime('2026-11-19 12:00:00 UTC');

Java

long seconds = java.time.Instant.now().getEpochSecond();
long millis  = System.currentTimeMillis();
java.time.Instant.ofEpochSecond(1700000000L);

C#

DateTimeOffset.UtcNow.ToUnixTimeSeconds();
DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
DateTimeOffset.FromUnixTimeSeconds(1700000000);

Go

time.Now().Unix()        // seconds
time.Now().UnixMilli()   // milliseconds
time.Unix(1700000000, 0).UTC()

Ruby

Time.now.to_i            # seconds
(Time.now.to_f * 1000).to_i
Time.at(1700000000).utc

Rust

use std::time::{SystemTime, UNIX_EPOCH};
SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs()

Bash

date +%s                      # seconds
date -u -d @1700000000        # timestamp -> date (GNU)
date -u -r 1700000000         # timestamp -> date (macOS/BSD)

SQL

-- PostgreSQL
SELECT EXTRACT(EPOCH FROM now())::bigint;
SELECT to_timestamp(1700000000);
-- MySQL
SELECT UNIX_TIMESTAMP(); SELECT FROM_UNIXTIME(1700000000);