Tool

Epoch & Unix Timestamp Converter

Convert Unix timestamps to human-readable dates and vice versa. Real-time epoch clock, local and GMT time support, professional developer tool.

The current Unix epoch time is

Loading...
Loading... Loading...

Timestamp to Date

Date to Timestamp

Year
Month
Day
Hour (0-23)
Minute
Second

What is Epoch Time?

The Unix epoch (also called Unix time, POSIX time, or a Unix timestamp) is the number of seconds since January 1, 1970, 00:00:00 UTC, not counting leap seconds (ISO 8601: 1970-01-01T00:00:00Z). Strictly speaking, the epoch is Unix time 0, but people often use "epoch" as shorthand for Unix time in general.

Some systems store epoch values as signed 32-bit integers, which can break on January 19, 2038, known as the Year 2038 Problem. This page converts timestamps in seconds (10 digits), milliseconds (13 digits), and microseconds (16 digits) into readable dates.

Human-readable time Seconds
1 hour3600 seconds
1 day86400 seconds
1 week604800 seconds
1 month (30.44 days)2629743 seconds
1 year (365.25 days)31556926 seconds

Code Examples

The first line for each language shows how to get the current epoch time. The second line shows how to convert an epoch timestamp to a human-readable date.

Replace the example epoch time 1800000000 with your own value. All examples return the epoch timestamp in seconds (and not milliseconds).

Python
import time; time.time()
import time; time.ctime(1800000000)
PHP
time()
date('r', 1800000000);
JavaScript
Math.floor(new Date().getTime() / 1000.0)
new Date(1800000000 * 1000).toLocaleString()
Java
long epoch = System.currentTimeMillis() / 1000;
String date = new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(new java.util.Date(1800000000 * 1000));
C++
double now = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
C#
DateTimeOffset.Now.ToUnixTimeSeconds()
new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(epoch).ToShortDateString();
Go
time.Now().Unix()
time.Unix(1800000000, 0)
SQL Variants
PostgreSQL:
SELECT EXTRACT(EPOCH FROM now());
SELECT TO_TIMESTAMP(1800000000);
MySQL:
SELECT UNIX_TIMESTAMP(NOW());
SELECT FROM_UNIXTIME(1800000000);
Unix/Linux Shell
date +%s
date -d @1800000000

Note: All tools on this page are based on the date & time settings of your computer and use JavaScript to convert times.