How to use the Unix timestamp converter
The top box shows the current Unix time, updating every second, with copy buttons for seconds and milliseconds. To read a timestamp, paste it into Timestamp to date. The tool guesses the unit from the number of digits; pick Seconds, Milliseconds, Microseconds or Nanoseconds if it guesses wrong. You get the date in your own time zone, UTC and Philippine time, plus ISO 8601, RFC 2822 and how long ago (or how far ahead) it is.
To go the other way, choose a date, a time and a time zone in Date to timestamp. The timestamp updates as you change any of them.
Worked example
The timestamp 1700000000 has 10 digits, so it is in seconds. It is 14 November 2023, 22:13:20 UTC. The Philippines is 8 hours ahead, so in Manila it was 15 November 2023, 06:13:20. In milliseconds the same moment is 1700000000000. Going back, entering 2023-11-15, 06:13:20 with the time zone Asia/Manila gives 1700000000 again.
Get the current timestamp in code
JavaScript
Math.floor(Date.now() / 1000) // seconds
Date.now() // millisecondsPython
import time
int(time.time()) # seconds
time.time_ns() // 1_000_000 # millisecondsPHP
time(); // seconds
(int) round(microtime(true) * 1000); // millisecondsJava
Instant.now().getEpochSecond() // seconds
System.currentTimeMillis() // millisecondsGo
time.Now().Unix() // seconds
time.Now().UnixMilli() // millisecondsSQL
-- MySQL / MariaDB
SELECT UNIX_TIMESTAMP();
-- PostgreSQL
SELECT EXTRACT(EPOCH FROM now())::bigint;
-- SQLite
SELECT strftime('%s', 'now');
-- SQL Server
SELECT DATEDIFF_BIG(SECOND, '1970-01-01', SYSUTCDATETIME());Frequently asked questions
What is a Unix timestamp?
It is the number of seconds that have passed since 1 January 1970 at 00:00:00 UTC, a moment called the Unix epoch. Because it is a single number with no time zone, it is the same everywhere in the world at the same instant, which makes it a popular way to store and compare times in software and databases.
How do I know if a timestamp is in seconds or milliseconds?
Count the digits. Present-day timestamps have 10 digits in seconds (e.g. 1700000000), 13 in milliseconds, 16 in microseconds and 19 in nanoseconds. Auto-detect uses this rule: values below 100 billion are treated as seconds, below 100 trillion as milliseconds, and so on. If your number is unusual, choose the unit yourself.
Can a Unix timestamp be negative?
Yes. Negative values count backwards from 1970. For example, -86400 is 31 December 1969 at 00:00:00 UTC, and -1 is one second before the epoch. This converter handles negative timestamps in both directions.
What is the year 2038 problem?
Older systems store Unix time as a signed 32-bit number, which can only count up to 2,147,483,647. That limit is reached on 19 January 2038 at 03:14:07 UTC (11:14:07 in the Philippines). One second later, those systems wrap around to a negative number and think it is 1901. Modern 64-bit systems, JavaScript and this tool are not affected, but old databases, embedded devices and file formats can be.
Why does Asia/Manila show UTC+08:00 all year?
The Philippines uses Philippine Standard Time, 8 hours ahead of UTC, and has not observed daylight saving time since 1978. So a Manila time is always the UTC time plus 8 hours. Zones such as America/New_York or Europe/London change their offset during the year; this tool uses your browser's time zone database to apply the right offset for each date.