My Tool Studio
Developer

Unix Timestamp Converter

This Unix timestamp converter turns epoch time into a readable date and turns a date back into epoch seconds and milliseconds. Paste a timestamp and the unit is detected from its size, or pick seconds, milliseconds, microseconds or nanoseconds yourself. The date appears in any time zone you choose, with ISO 8601, RFC 2822, the UTC offset and relative time, plus the same moment in 17 other zones. Going the other way, pick a date, time and zone, or type any date text. Extra panels give the start and end of the day, week, month and year, batch convert up to 5,000 lines, turn seconds into days and hours, and show code for 11 languages. It runs in your browser.

Always freeNo sign upRuns in your browser
Current Unix time
...

Unix timestamp to date

Seconds, ms, microseconds or nanoseconds.

Date to Unix timestamp

ISO 8601 such as 2026-05-26T12:00:00Z or +05:30, or RFC 2822. Without Z or an offset it is read in your browser's time zone.

Seconds1767225600
Milliseconds1767225600000
UTCThu, 01 Jan 2026 00:00:00 GMT

Batch convert

One value per line. Timestamps become dates in the time zone chosen above; dates become Unix seconds. Up to 5,000 lines.

Seconds to days, hours and minutes

1 day, 1 hour, 1 minute, 1 second (1.04 days)

Get the current timestamp in code
JavaScript
Math.floor(Date.now() / 1000)   // seconds
Date.now()                       // milliseconds
new Date(1767225600 * 1000)      // to a Date
Python
import time, datetime
int(time.time())
datetime.datetime.fromtimestamp(1767225600, datetime.timezone.utc)
PHP
time();
date('Y-m-d H:i:s', 1767225600);
Java
Instant.now().getEpochSecond();
Instant.ofEpochSecond(1767225600);
C#
DateTimeOffset.UtcNow.ToUnixTimeSeconds();
DateTimeOffset.FromUnixTimeSeconds(1767225600);
Go
time.Now().Unix()
time.Unix(1767225600, 0).UTC()
Ruby
Time.now.to_i
Time.at(1767225600).utc
MySQL
SELECT UNIX_TIMESTAMP();
SELECT FROM_UNIXTIME(1767225600);
PostgreSQL
SELECT EXTRACT(EPOCH FROM now())::bigint;
SELECT to_timestamp(1767225600);
Bash
date +%s
date -u -d @1767225600    # GNU
date -u -r 1767225600     # macOS
PowerShell
[DateTimeOffset]::UtcNow.ToUnixTimeSeconds()

How to use

01

Enter a timestamp

Type or paste a value into Unix timestamp. Today's dates are 10 digits in seconds and 13 in milliseconds, and Detect from length works out the unit. Choose a zone under Show in time zone.

02

Read the date or convert back

The results show the unit, the date in your zone, ISO 8601, RFC 2822, the offset and relative time, each with Copy. Under Date to Unix timestamp, pick a date, time and zone to get seconds and milliseconds.

03

Use the extra tools

Copy start and end timestamps for a day, week, month or year, paste a list into Batch convert and download a CSV, or turn a number of seconds into days, hours and minutes.

Why Unix Timestamp Converter

Seconds, milliseconds, microseconds and nanoseconds

Different systems count Unix time in different units, and mixing them up is a classic bug. If a 13-digit millisecond value is read as seconds, you get a date tens of thousands of years in the future. If a 10-digit seconds value is read as milliseconds, you get a date in January 1970.

The table shows the same moment, 1 January 2026 at 00:00 UTC, in each unit. This converter tells them apart by size, so paste any of these and you get the same date back.

UnitDigits todayExampleWhere you see it
Seconds101767225600Unix tools, PHP time(), JWT exp and iat claims
Milliseconds131767225600000JavaScript Date.now(), Java, many JSON APIs
Microseconds161767225600000000Some databases and tracing tools
Nanoseconds191767225600000000000Go's UnixNano(), InfluxDB, OpenTelemetry

Get the current Unix timestamp in code

Most languages have a one-line way to read the current time as a Unix timestamp. Seconds are the traditional unit; milliseconds are the default in JavaScript and Java. Compare the value your code prints with the live clock at the top of this page to confirm you are using the unit you expect. When you store timestamps, pick one unit for the whole system and name the column or field after it, such as created_at_ms.

LanguageSecondsMilliseconds
JavaScriptMath.floor(Date.now() / 1000)Date.now()
Pythonint(time.time())int(time.time() * 1000)
PHPtime()(int) (microtime(true) * 1000)
JavaInstant.now().getEpochSecond()System.currentTimeMillis()
Gotime.Now().Unix()time.Now().UnixMilli()
PostgreSQLEXTRACT(EPOCH FROM now())::bigint(EXTRACT(EPOCH FROM now()) * 1000)::bigint
MySQLUNIX_TIMESTAMP()Not built in as one call
Bash (GNU date)date +%sdate +%s%3N

Common questions

How do I tell seconds from milliseconds in a Unix timestamp?
Count the digits. Current dates are 10 digits in seconds and 13 digits in milliseconds. This converter checks the size automatically and shows the unit it used in the Read as row. Set Unit yourself if the guess is wrong, for example for a small millisecond value close to 1970.
What date does Unix timestamp 0 convert to?
1 January 1970 at 00:00:00 UTC, the Unix epoch. In India that is 05:30 the same morning, and in New York it is 19:00 on 31 December 1969.
Can I convert dates before 1970 to a Unix timestamp?
Yes. Earlier dates are negative numbers. -86400 is 31 December 1969 at 00:00 UTC, exactly one day before the epoch. Type a minus sign followed by the digits in the timestamp box.
Why does my converted timestamp show the wrong hour?
Usually it is a time zone mix-up. A Unix timestamp always counts from UTC, and only the display changes with the zone, so check the Show in time zone setting. Under Date to Unix timestamp, the picked time is read in the zone next to it, and typed date text without Z or an offset is read in your browser's zone.
What is the year 2038 problem with Unix time?
Systems that store Unix time as a signed 32-bit integer run out of room after 03:14:07 UTC on 19 January 2038, which is timestamp 2147483647. Most modern systems use 64-bit time and are not affected. This converter uses JavaScript dates, which handle years far beyond 2038.
Is Unix time affected by leap seconds?
No. Unix time treats every day as exactly 86,400 seconds and ignores leap seconds, so the count briefly repeats or skips when one occurs. For almost all software this makes no visible difference.
What is the difference between epoch time and Unix time?
They usually mean the same thing: seconds since 00:00:00 UTC on 1 January 1970. Epoch just means the starting point, and some systems use other ones, such as 1 January 2001 for Apple's Core Data or 1 January 1601 for Windows file times.
What does an ISO 8601 date look like?
It looks like 2026-05-26T12:00:00Z: year, month and day, the letter T, the time, then Z for UTC or an offset such as +05:30. It sorts correctly as plain text, which is why APIs and log files use it.
Does the timestamp converter handle daylight saving time?
Yes. The zones in the list are named zones such as Europe/London and America/New_York, so the displayed time follows their daylight saving rules for that date. UTC never changes.
How do I convert many timestamps at once?
Paste them into Batch convert, one per line. Numbers become dates in the zone chosen above, and date text becomes Unix seconds, up to 5,000 lines at a time. Copy the results or download a CSV with the input, the result and an extra column.

More Developer tools

View all