Skip to content
{}

Unix Timestamp Converter

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

0 chars | 1 lines
0 chars | 0 lines

Conversion payloads stay in this browser tab and are never placed in page URLs - see how local processing works. Privacy-safe analytics record only the tool, outcome, and a coarse input-size bucket.

How to Convert Unix Timestamps

Enter a Unix timestamp (seconds since epoch) to see the human-readable date. Or enter a date to get the Unix timestamp. The converter auto-detects which format you've entered.

What is Unix Time?

Unix time (also called Epoch time or POSIX time) counts seconds from January 1, 1970 UTC. It's timezone-independent and used extensively in programming and databases.

Why Use Unix Timestamps?

Unix timestamps are timezone-independent, easy to sort and compare, compact to store, and universally supported across programming languages and databases.

Common Use Cases

Developers use timestamp conversion when debugging logs, working with APIs that use epoch time, converting database timestamps, or calculating time differences.

Get the Current Unix Timestamp in Code

Every language has a one-liner for the current epoch time. These snippets return seconds since January 1, 1970 UTC.

JavaScript

Math.floor(Date.now() / 1000)

Python

import time
int(time.time())

Go

time.Now().Unix()

Java

Instant.now().getEpochSecond()

SQL (PostgreSQL)

SELECT extract(epoch from now())::bigint;

Bash

date +%s

Convert a Timestamp to a Date in Code

Going the other way - from epoch seconds to a readable date:

JavaScript

new Date(1704067200 * 1000).toISOString()

Python

from datetime import datetime, timezone
datetime.fromtimestamp(1704067200, tz=timezone.utc)

Go

time.Unix(1704067200, 0).UTC()

Bash

date -u -d @1704067200   # GNU
date -u -r 1704067200   # macOS/BSD

Frequently Asked Questions

What is a Unix timestamp?

A Unix timestamp is the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC (the Unix epoch).

Does this handle milliseconds?

Yes, the converter auto-detects whether the input is in seconds or milliseconds and converts accordingly.

What timezone is used?

The converter shows both UTC time and your local timezone. You can see the exact time in both formats.

What date formats are accepted?

The converter accepts various formats including ISO 8601 (2024-01-01T00:00:00Z), common formats (Jan 1, 2024), and natural language (today, yesterday).

Related Tools