This domain & website is for sale — just $200huzaifa.pro.dev@gmail.com

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

Interpret this time as

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 +%s

    GNU 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. 1

    Paste a timestamp

    Enter a value in seconds, milliseconds, microseconds or nanoseconds. Commas, spaces and underscores are ignored.

  2. 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. 3

    Copy the format you need

    Copy the date in local time, UTC, ISO 8601, RFC 2822 or as seconds and milliseconds.

  4. 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,000
  • seconds = 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

TimestampUTC dateNote
01970-01-01T00:00:00ZThe Unix epoch
10000000002001-09-09T01:46:40ZThe first 10-digit timestamp
17000000002023-11-14T22:13:20ZSeconds (10 digits)
17000000001232023-11-14T22:13:20.123ZMilliseconds (13 digits)
21474836472038-01-19T03:14:07ZLargest signed 32-bit value
-864001969-12-31T00:00:00ZOne 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.