Skip to content
Util.Ninja

Epoch Converter: Unix Timestamp to Date and Back

Turn a Unix timestamp into a readable date, or a date into epoch time, in any time zone. The unit (seconds, milliseconds, microseconds or nanoseconds) is detected for you, and you can also type plain English such as “next Friday at 3pm” or convert a whole list at once.

Current Unix time

0

seconds since 1 January 1970 (UTC)

UTC (GMT)–
Your time zone–

Epoch to date

Date to epoch

Uses the time zone selected at the top. 24-hour clock.

Describe a time in plain English

Batch converter

Paste one timestamp or date per line (up to 2,000). Numbers become dates, dates and words become timestamps.

InputDetectedUnix secondsISO 8601 (UTC)ISO 8601 (UTC)

How to use

  1. Epoch to date: paste a Unix timestamp. The unit is detected from the digit count (10 = seconds, 13 = milliseconds, 16 = microseconds, 19 = nanoseconds), or choose it yourself.
  2. Date to epoch: fill in the year, month, day and time. You get seconds, milliseconds, microseconds and nanoseconds.
  3. Pick the time zone at the top. It is used for every converter on the page, and it is remembered next time.
  4. Use Describe a time for phrases like “tomorrow at 9am”, or the Batch converter for a list. Press the copy icon next to any result.
  5. Copy link makes a link that opens this page with your timestamp already filled in.

What is epoch time?

Epoch time, also called Unix time or POSIX time, counts the seconds since 00:00:00 UTC on 1 January 1970, the Unix epoch. Because it is one number with no time zone, it is the easiest way for programs, databases, logs and APIs to agree on an exact moment. A timestamp such as 1700000000 means 14 November 2023 22:13:20 UTC wherever you are; only the clock time you read changes with the time zone.

Many systems store milliseconds instead of seconds: JavaScript’s Date.now(), Java and most JSON APIs do. Databases and high-resolution timers may use microseconds or nanoseconds. If a converted date lands in 1970 or in the far future, the unit is probably wrong: the number is 1,000 times too big or too small.

Seconds in common time units

UnitSeconds
1 second1
1 minute60
1 hour3,600
1 day86,400
1 week604,800
1 month (30.44 days)2,629,743
1 year (365.24 days)31,556,926

Get the current epoch time in code

LanguageCurrent Unix time in seconds
JavaScriptMath.floor(Date.now() / 1000)
Pythonimport time; int(time.time())
PHPtime()
JavaSystem.currentTimeMillis() / 1000L
C#DateTimeOffset.UtcNow.ToUnixTimeSeconds()
Gotime.Now().Unix()
RubyTime.now.to_i
RustSystemTime::now().duration_since(UNIX_EPOCH)?.as_secs()
SwiftInt(Date().timeIntervalSince1970)
KotlinSystem.currentTimeMillis() / 1000
C / C++time(NULL) // std::time(nullptr)
MySQLSELECT UNIX_TIMESTAMP();
PostgreSQLSELECT EXTRACT(EPOCH FROM now())::bigint;
SQL ServerSELECT DATEDIFF(SECOND, '1970-01-01', GETUTCDATE());
Bashdate +%s
PowerShell[DateTimeOffset]::UtcNow.ToUnixTimeSeconds()
Excel=(NOW()-DATE(1970,1,1))*86400 (for UTC use a UTC time)

Frequently asked questions

What is epoch time (Unix time)?

Epoch time is the number of seconds that have passed since 1 January 1970 at 00:00:00 UTC, not counting leap seconds. It is a single number that means the same instant in every time zone, which is why computers, databases and APIs use it.

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

Count the digits. Today a timestamp in seconds has 10 digits (like 1700000000), milliseconds have 13, microseconds 16 and nanoseconds 19. This converter detects the unit from the number of digits, and you can also pick the unit yourself.

Is a Unix timestamp in UTC or local time?

A Unix timestamp has no time zone: it counts from the epoch in UTC. The time zone only matters when you turn it into a readable date, so this tool shows the same instant in UTC and in your own or any other zone you choose.

What happens in the year 2038?

Systems that store the timestamp in a signed 32-bit integer overflow on 19 January 2038 at 03:14:07 UTC (timestamp 2147483647). Modern systems use 64-bit values, which last for billions of years.

Can a timestamp be negative?

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

Are my timestamps sent to a server?

No. All conversions run in your browser with JavaScript. Nothing you type is uploaded or stored on our servers.

More free tools

QR code generatorLinks, Wi-Fi, contacts, PNG & SVGImage compressor & resizerShrink and resize JPG, PNG, WebPPassword generatorStrong passwords & passphrasesJSON formatter & validatorBeautify, validate, tree viewBase64 encode / decodeText to Base64 and backJSON minifierMake JSON smallerJS, CSS & HTML minifierShrink code for faster pagesURL / URI encoderPercent-encode and decodeGUID / UUID generatorUnique IDs in one click