Developer

Unix Timestamp Converter - Epoch Timestamp to Date & Back

Convert Unix timestamps to dates as you type, in seconds, milliseconds, microseconds or nanoseconds, and turn any date back into epoch time.

100% Client-SideNo Tool Data StoredFree to UseNo Account Needed
Unix Timestamp Converter
Current Unix timestamp  

Timestamp to date

Date to timestamp

Get and convert Unix time in code

The current timestamp in seconds, and a timestamp ts turned into a date.

JavaScript
Now: Math.floor(Date.now() / 1000)
To date: new Date(ts * 1000).toISOString()
Python
Now: int(time.time())
To date: datetime.fromtimestamp(ts, tz=timezone.utc)
PHP
Now: time()
To date: date('c', $ts)
Java
Now: Instant.now().getEpochSecond()
To date: Instant.ofEpochSecond(ts)
C#
Now: DateTimeOffset.UtcNow.ToUnixTimeSeconds()
To date: DateTimeOffset.FromUnixTimeSeconds(ts)
Go
Now: time.Now().Unix()
To date: time.Unix(ts, 0).UTC()
Ruby
Now: Time.now.to_i
To date: Time.at(ts).utc
Rust
Now: SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs()
To date: UNIX_EPOCH + Duration::from_secs(ts)
SQL (MySQL)
Now: UNIX_TIMESTAMP()
To date: FROM_UNIXTIME(ts)
SQL (PostgreSQL)
Now: EXTRACT(EPOCH FROM now())::bigint
To date: to_timestamp(ts)
Bash
Now: date +%s
To date: date -u -d @$ts
Excel / Sheets
Now: =(NOW()-DATE(1970,1,1))*86400
To date: =A1/86400+DATE(1970,1,1)

Seconds in a minute, hour, day and year

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

How to Use Unix Timestamp Converter

  1. 1

    Paste a Unix timestamp. It converts as you type, and the unit (seconds, ms, µs or ns) is detected for you.

  2. 2

    Copy the date in UTC, your local time, ISO 8601, RFC 2822 or relative time.

  3. 3

    To go the other way, pick a date and time under Date to timestamp, choose local time or UTC, and copy the timestamp.

About Unix Timestamp Converter

The Unix timestamp converter turns epoch time into a readable date and back. The current timestamp ticks live at the top. Paste any timestamp and see it in UTC, in your own time zone, in ISO 8601 and RFC 2822, and as relative time, along with the day of the year and the ISO week number.

Seconds, milliseconds, microseconds and nanoseconds

Different systems count in different units. Unix tools, PHP and most databases use seconds (10 digits today). JavaScript's Date.now() and Java use milliseconds (13 digits). Some logs and Python's time.time_ns() use microseconds or nanoseconds (16 or 19 digits). The converter reads the length of the number to pick the unit and tells you which one it used; you can also choose it yourself.

Time zones

A Unix timestamp has no time zone: it marks the same moment everywhere. Time zones only matter when you show it as a date or turn a date into a timestamp. That's why Date to timestamp asks whether the date you picked is local time or UTC, and switching between them keeps the same moment.

Reference

Under the converter you'll find how to get the current timestamp and convert one to a date in 12 languages and tools, from JavaScript and Python to SQL, Bash and spreadsheets, plus the number of seconds in a minute, hour, day, week, month and year. Everything runs in your browser.

FRI

Built by

Fateh Raiyan Ishmum

Full-stack dev since 2020. Full-stack web developer since 2020. Builds privacy-first, open-web tools. Specialises in Next.js, TypeScript, and performance-focused design.

Frequently Asked Questions

A Unix timestamp, also called epoch time or POSIX time, counts the seconds since January 1, 1970 at 00:00:00 UTC, the Unix epoch. It's the same number everywhere in the world, which is why databases, APIs and log files use it.

Paste the timestamp in the box. The date appears straight away in UTC, in your own time zone, in ISO 8601 and RFC 2822, and as relative time such as "3 hours ago". Tap the copy button next to any line.

Count the digits. A 10-digit timestamp (like 1700000000) is in seconds, 13 digits is milliseconds, 16 is microseconds and 19 is nanoseconds. The converter detects this by itself and says which unit it used; pick one by hand if you need to.

Use Date to timestamp: pick the date and time, choose whether it's in your local time or UTC, and copy the timestamp in seconds or milliseconds. The same wall-clock time gives different timestamps in different time zones.

It's shown live at the top of the converter, in seconds and milliseconds, and ticks every second. Copy either value with one tap.

Systems that store Unix time as a signed 32-bit number run out on January 19, 2038 at 03:14:07 UTC, when the count passes 2,147,483,647 (the Y2038 problem). 64-bit timestamps, used by modern systems, last for billions of years.

JavaScript: Math.floor(Date.now() / 1000). Python: int(time.time()). PHP: time(). Go: time.Now().Unix(). Bash: date +%s. The table under the converter lists more languages and how to turn a timestamp back into a date.

More Free Tools

Most Popular