Epoch / Unix Timestamp Converter

Convert Unix timestamps to human-readable dates and vice versa.

The current Unix epoch time is

1790213975

Timestamp to Date

Date to Timestamp

Also accepts YYYY/MM/DD and other standard formats if typed manually (type="text").

Unix time: units, time zones, the 2038 limit and how to read any timestamp

Unix time (also POSIX time or epoch time) is the number of seconds elapsed since 1970-01-01 00:00:00 UTC, the Unix epoch. It has no time zone: two machines in Hyderabad and Toronto reading the clock at the same instant get the same number. Times before 1970 are negative. Leap seconds are deliberately ignored, so every day is exactly 86,400 seconds in this scale, which keeps arithmetic simple at the cost of a one-second wobble whenever the astronomers insert one. Because it is a plain integer, it sorts, subtracts and indexes well, which is why databases, log files, file systems and tokens all use it.

What this converter does

The clock at the top shows the current Unix time in seconds and ticks every second. The "Timestamp to Date" box takes a number and shows it two ways: your browser's local time (via toLocaleString(), so in India that is IST) and UTC. It decides the unit by size: a value above 99,999,999,999 (twelve or more digits) is treated as milliseconds, anything smaller as seconds. The "Date to Timestamp" box parses a date string with the browser's Date parser and returns whole seconds. Microsecond and nanosecond values are not detected; divide by 1,000 or 1,000,000 first. JavaScript numbers are exact only up to 2^53 - 1, so a 19-digit nanosecond value could not be represented precisely anyway.

Which unit is my timestamp?

Digits (today)UnitWhere you see it
10secondsUnix tools, date +%s, JWT exp and iat, PostgreSQL EXTRACT(EPOCH ...), Go time.Now().Unix()
13millisecondsJavaScript Date.now(), Java System.currentTimeMillis(), Kafka record timestamps, MongoDB dates
16microsecondsPostgreSQL internals, Python datetime resolution, Chrome history database (counted from 1601, not 1970)
19nanosecondsGo UnixNano(), Linux stat fields, Rust Instant, InfluxDB

Two other counters are easily mistaken for Unix time. Windows FILETIME counts 100-nanosecond intervals since 1601-01-01 and .NET ticks count the same interval since 0001-01-01; both are 18 or 19 digits and need a different epoch. Excel stores dates as days since 1899-12-30 with the time as a fraction, so 45292 is 1 January 2024.

The time zone trap in date strings

Converting a date back to a timestamp depends on how the string is parsed. By the JavaScript specification, a date-only string such as 2024-01-01 is read as midnight UTC, but a date-time string without an offset, such as 2024-01-01T09:00:00, is read as local time. Other formats fall back to engine-specific rules. The reliable habit is to always write the offset: 2024-01-01T00:00:00Z is 1704067200 while 2024-01-01T00:00:00+05:30 is 1704047400; the 19,800-second gap is exactly the 5 hours 30 minutes of Indian Standard Time. IST has no daylight saving, and its IANA name is Asia/Kolkata. Store and transmit UTC or a full RFC 3339 string with an offset, and convert to local time only when displaying to a person.

Limits: 2038 and beyond

A signed 32-bit integer runs out at 2,147,483,647, which is 2038-01-19 03:14:07 UTC. After that second it wraps to a negative number and reads as December 1901. Modern operating systems and languages use 64-bit values, but the limit survives in places: MySQL's TIMESTAMP column type ends at 2038-01-19 (use DATETIME for later dates), old embedded firmware, and some file formats. JavaScript's Date covers plus or minus 8.64 x 10^15 milliseconds, about 285,000 years either side of 1970, so the browser is not the bottleneck.

Leap seconds

UTC has had 27 leap seconds since 1972, the last on 31 December 2016. Unix time does not count them: during a leap second the clock either repeats a value or, on systems using Google's or Amazon's "smear", runs slightly slow for a few hours around midnight. For nearly every application this is invisible, but it explains why a difference between two timestamps can be off by one second across those dates. The international decision in 2022 was to stop inserting leap seconds by 2035.

Command-line and SQL equivalents

date +%s                                        # now, in seconds
date -d @1704067200                             # GNU/Linux: timestamp to local time
date -u -r 1704067200                           # macOS / BSD
[DateTimeOffset]::FromUnixTimeSeconds(1704067200)          # PowerShell
python3 -c "import datetime as d; print(d.datetime.fromtimestamp(1704067200, d.timezone.utc))"
node -e "console.log(new Date(1704067200*1000).toISOString())"
SELECT to_timestamp(1704067200), EXTRACT(EPOCH FROM now());   -- PostgreSQL
SELECT FROM_UNIXTIME(1704067200), UNIX_TIMESTAMP();          -- MySQL
SELECT datetime(1704067200, 'unixepoch');                    -- SQLite

Reading a timestamp out of a JWT

The exp and iat claims are Unix seconds. Paste them here after decoding a token in the JWT Debugger; a 13-digit value means the issuer used milliseconds by mistake and the token will be treated as valid for thousands of years.

How to use

  1. Read the live Unix time at the top of the page; press Refresh to reset the counter if the tab was in the background.
  2. Paste a 10-digit (seconds) or 13-digit (milliseconds) timestamp into Timestamp to Date and press Convert to see it in your local time zone and in UTC.
  3. For a microsecond or nanosecond value, divide by 1,000 or 1,000,000 first so it is in milliseconds or seconds.
  4. Type a date into Date to Timestamp, ideally with an explicit offset such as 2024-01-01T09:30:00+05:30, and press Convert to get Unix seconds.
  5. Multiply the result by 1000 if the destination (JavaScript, Java, Kafka) expects milliseconds.

Common use cases

  • Reading timestamps in raw application logs, audit trails and S3 or CloudWatch exports.
  • Building a time-bounded query against a table that stores Unix integers instead of a date type.
  • Checking why a JWT or a cache entry expires immediately (seconds versus milliseconds confusion).
  • Cross-referencing an incident across services that log in different units and zones.
  • Confirming the 2038 exposure of a MySQL TIMESTAMP column or a legacy 32-bit device.
  • Converting an IST meeting time to UTC for a cron schedule on a server that runs in UTC.

Frequently asked questions

What time zone is a Unix timestamp in?

None. It counts seconds since 1970-01-01 00:00:00 UTC and is the same number everywhere on Earth at a given instant. Time zones only enter when the number is turned into a calendar date for display, which is why this page shows both your local time and UTC.

Why is the JavaScript timestamp so much larger than the one in my database?

JavaScript Date.now() returns milliseconds, so it has 13 digits, while most databases and Unix tools use seconds with 10 digits. Multiply by 1000 or divide by 1000 to convert. This page detects milliseconds automatically when the value has twelve or more digits.

What is the Year 2038 problem?

A signed 32-bit integer cannot represent a value above 2,147,483,647, which corresponds to 2038-01-19 03:14:07 UTC. Systems that still store Unix time in 32 bits wrap to a negative number at that moment. 64-bit systems are unaffected, but MySQL TIMESTAMP columns and some embedded devices still carry the limit.

Does Unix time include leap seconds?

No. Unix time assumes every day has exactly 86,400 seconds. During a leap second the operating system repeats a second or smears the extra second over several hours. UTC has had 27 leap seconds since 1972, the most recent on 31 December 2016.

Why is my converted date off by 5 hours 30 minutes?

You are comparing a UTC reading with an IST reading. India is UTC+05:30 all year with no daylight saving, so 2024-01-01T00:00:00+05:30 is 1704047400 while midnight UTC on the same date is 1704067200. Always include the offset when you type a date-time string.

Can I convert a timestamp to IST specifically?

The Local column uses the time zone your browser and operating system are set to, so on a machine set to India it is IST. If your machine is set to another zone, use the UTC column and add 5 hours 30 minutes, or use a library that accepts the Asia/Kolkata zone name.

Are negative timestamps valid?

Yes. They represent instants before 1970, for example -86400 is 31 December 1969 00:00:00 UTC. Not every system accepts them (MySQL TIMESTAMP does not), and some languages misparse them, so check the destination before storing dates of birth this way.

Why does Date to Timestamp say Invalid Date?

The browser could not parse the string. Use ISO 8601 / RFC 3339 form, such as 2024-01-01T09:30:00Z or 2024-01-01T09:30:00+05:30. Formats like 01/02/2024 are ambiguous (day-first in India, month-first in the United States) and may parse differently between browsers.

Advertisement