Unix Timestamp Converter
See the current epoch time tick live, turn any Unix timestamp into a readable date, and convert a date and time back into seconds or milliseconds.
- Auto-detects s, ms and µs
- Local, UTC, ISO 8601 and RFC 2822
- Date to timestamp in local or UTC
Current Unix time
Seconds
…
Milliseconds
…
Timestamp → date
Date → timestamp
Pick a date and time to see its timestamp.
Get the current epoch in code
Each snippet returns the current Unix time in seconds.
JavaScript
Math.floor(Date.now() / 1000)Date.now() alone returns milliseconds
Python
import time int(time.time())time.time() returns a float in seconds
PHP
time()microtime(true) gives seconds with a fraction
MySQL
SELECT UNIX_TIMESTAMP();FROM_UNIXTIME(ts) converts back
PostgreSQL
SELECT EXTRACT(EPOCH FROM NOW())::bigint;to_timestamp(ts) converts back
SQLite
SELECT strftime('%s', 'now');Returns the value as text
Bash / shell
date +%sGNU date: date -d @ts converts back
Java
Instant.now().getEpochSecond()System.currentTimeMillis() for ms
Go
time.Now().Unix()time.Now().UnixMilli() for ms
How it works
How to convert a timestamp
- 1
Paste a timestamp
Enter a value in seconds, milliseconds, microseconds or nanoseconds. Commas, spaces and underscores are ignored.
- 2
Check the detected unit
The badge shows how the number was read. Change the Unit menu if your value uses a different unit.
- 3
Copy the format you need
Copy the date in local time, UTC, ISO 8601, RFC 2822 or as seconds and milliseconds.
- 4
Go the other way
Pick a date and time, choose whether it is local time or UTC, and copy the resulting timestamp.
How epoch time is calculated
Unix time counts seconds from the epoch, 1970-01-01 00:00:00 UTC. Every day is treated as exactly 86,400 seconds, so leap seconds are not counted. To convert by hand:
milliseconds = seconds × 1,000seconds = floor(milliseconds ÷ 1,000)days since epoch = floor(seconds ÷ 86,400)
ISO 8601 (2023-11-14T22:13:20.000Z) is the format to use in JSON and APIs. RFC 2822 (Tue, 14 Nov 2023 22:13:20 +0000) is the format used in email headers and RSS feeds.
Reference timestamps
| Timestamp | UTC date | Note |
|---|---|---|
| 0 | 1970-01-01T00:00:00Z | The Unix epoch |
| 1000000000 | 2001-09-09T01:46:40Z | The first 10-digit timestamp |
| 1700000000 | 2023-11-14T22:13:20Z | Seconds (10 digits) |
| 1700000000123 | 2023-11-14T22:13:20.123Z | Milliseconds (13 digits) |
| 2147483647 | 2038-01-19T03:14:07Z | Largest signed 32-bit value |
| -86400 | 1969-12-31T00:00:00Z | One day before the epoch |
Common use cases
Reading logs
Turn the raw numbers in server logs and analytics exports into readable dates.
Debugging APIs
Check token expiry (exp, iat) values and created_at fields returned in seconds or milliseconds.
Writing database queries
Get the exact epoch value for a date range in a WHERE clause.
Scheduling
Work out the timestamp for a future date in UTC before storing it.
Frequently Asked Questions
What is a Unix timestamp?
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970, not counting leap seconds. It is the same number everywhere in the world, which is why it is used to store and compare times in databases and APIs.
How does the tool tell seconds from milliseconds?
It looks at how many digits the number has. Up to 11 digits is read as seconds, 12 to 14 digits as milliseconds, 15 to 17 as microseconds and 18 or more as nanoseconds. Today's time is 10 digits in seconds and 13 in milliseconds. You can override the guess with the Unit menu.
What is the Year 2038 problem?
Systems that store Unix time as a signed 32-bit integer can only count up to 2,147,483,647, which is 03:14:07 UTC on 19 January 2038. One second later the value overflows. Storing timestamps as 64-bit integers avoids the problem.
Can Unix timestamps be negative?
Yes. A negative timestamp is a moment before 1 January 1970. For example, -86400 is 00:00:00 UTC on 31 December 1969. The converter accepts negative values.
Does a Unix timestamp depend on my time zone?
No. The timestamp itself is always counted from UTC. Only the way it is displayed changes, which is why the tool shows the same moment in your local time and in UTC. When converting a date to a timestamp, choose whether the date you entered is local time or UTC.
Keep going
Related Tools
Hand-picked tools that pair well with this one. All free, no sign-up.
- Developers
Cron Job Generator
Build cron expressions and full crontab entries for recurring jobs.
- Common presets
- Copy cron line
- Quick validation
Open tool - Developers
JWT Decoder
Decode JSON Web Token headers and payloads instantly, with readable expiry times and token status, right in your browser.
- Header & payload
- Expiry status
- Runs locally
Open tool - Everyday
Age Calculator
Find your exact age in years, months, and days, plus total days lived and a countdown to your next birthday.
- Exact age
- Next birthday
- Leap-year accurate
Open tool