NinjaFunction (Ninja Function) logo

Unix Timestamp Converter

Convert Unix timestamps to readable dates and dates back to timestamps, in any time zone. See the current Unix time live.


Current Unix time

…

 

Dates are shown in this time zone, and the date you enter on the right is read in it. Unix timestamps themselves are always in UTC.

Timestamp to date

Enter a timestamp to see the date.

Date to timestamp

Read in UTC
Pick a date and time to get its Unix timestamp.

About This Tool

NinjaFunction's Unix Timestamp Converter turns epoch time into a readable date, and a date into a Unix timestamp, in seconds. It detects seconds, milliseconds, microseconds and nanoseconds for you, works in any time zone, and shows the current Unix time live. Copy the result as a local date, UTC, ISO 8601 or a relative time such as 3 hours ago. Everything runs in your browser, so nothing you enter is sent to a server.

🔑 How to Use

  1. Choose your time zone. It starts as the time zone of your device. Pick any other one from the list.
  2. To turn a timestamp into a date, paste it into the box on the left. The unit is detected for you, and the date appears below in several formats.
  3. To turn a date into a timestamp, pick a date and time on the right. The seconds, milliseconds and ISO 8601 value appear below.
  4. Copy what you need with the Copy button next to each result.

💡 Pro Tips

  • ✔ Use current time fills in the live Unix time with one click.
  • ✔ Pick the unit yourself if a timestamp looks wrong. A 13-digit value read as seconds gives a date thousands of years away.
  • ✔ Set the time zone first, then enter the date, so it is read in the right zone.

What Is a Unix Timestamp?

Unix time counts the seconds since the Unix epoch: 1 January 1970 at 00:00:00 UTC. It is used in databases, log files, APIs and almost every programming language, because one number is simpler to store, sort and compare than a written date.

The same timestamp means the same moment everywhere. A server in India and one in Canada both read 1700000000 as the same instant, and each only changes how it shows the local clock time.

Common Timestamps

TimestampDate and time (UTC)Why it matters
01 Jan 1970, 00:00:00The Unix epoch
864002 Jan 1970, 00:00:00Exactly one day later
10000000009 Sep 2001, 01:46:40One billion seconds
170000000014 Nov 2023, 22:13:20A handy example value
214748364719 Jan 2038, 03:14:07The largest 32-bit value (Year 2038 problem)

Seconds, Milliseconds or Microseconds?

The same moment can be written with different units. The number of digits tells you which one you have:

DigitsUnitExampleOften used in
10Seconds1700000000Databases, Python, PHP, Linux
13Milliseconds1700000000000JavaScript, Java
16Microseconds1700000000000000Some databases and logs
19Nanoseconds1700000000000000000Go, high-precision tools

Get the Current Timestamp in Code

LanguageSeconds since the epoch
JavaScriptMath.floor(Date.now() / 1000)
Pythonint(time.time())
PHPtime()
JavaInstant.now().getEpochSecond()
C#DateTimeOffset.UtcNow.ToUnixTimeSeconds()
Gotime.Now().Unix()
RubyTime.now.to_i
MySQLUNIX_TIMESTAMP()
PostgreSQLEXTRACT(EPOCH FROM now())
Bashdate +%s

Need a unique ID rather than a time? Try the UUID Generator, whose version 7 IDs also contain a timestamp, or decode the expiry time inside a token with the JWT Decoder.

The Year 2038 Problem

Older systems store Unix time in a 32-bit signed number. The largest value it can hold is 2,147,483,647, which is 19 January 2038 at 03:14:07 UTC. One second later the number overflows and wraps to a negative value, which would read as a date in 1901. Modern systems use 64-bit numbers, which last for hundreds of billions of years, so the problem mostly affects very old software and embedded devices.

Frequently Asked Questions

What is a Unix timestamp?

A Unix timestamp is the number of seconds that have passed since 1 January 1970 at 00:00:00 UTC. That starting moment is called the Unix epoch. Because it is just one number, it is an easy way for computers to store and compare dates.

How do I know if a timestamp is in seconds or milliseconds?

Count the digits. A timestamp with 10 digits, such as 1700000000, is in seconds. One with 13 digits, such as 1700000000000, is in milliseconds. JavaScript and Java often use milliseconds, while most databases and command-line tools use seconds. This tool detects the unit for you, and you can also pick it yourself.

Does a Unix timestamp depend on the time zone?

No. A timestamp is the same number everywhere in the world, because it always counts from the epoch in UTC. Only the date and clock time you read from it change with the time zone.

Can a Unix timestamp be negative?

Yes. Negative numbers are moments before 1 January 1970. For example, -86400 is 31 December 1969 at 00:00:00 UTC.

What is the Year 2038 problem?

Some older systems store the timestamp as a 32-bit signed number, which can only count up to 2,147,483,647. That moment is 19 January 2038 at 03:14:07 UTC. After it, the number overflows and the date can jump back to 1901. Systems that use 64-bit numbers do not have this limit.

How do I convert a Unix timestamp to a date in Excel?

If the timestamp is in cell A1 and is in seconds, type =A1/86400+DATE(1970,1,1) in another cell, then format that cell as a date and time. For milliseconds, divide by 86400000 instead.

Is my data sent to a server?

No. All conversions are done in your browser. Nothing you type is sent or stored.

Always FreeAll tools are 100% free to use.
No Sign UpNo registration or login required.
Blazing FastInstant results, always.