Epoch & Timestamp Converter

Convert timestamp to date format or get timestamp of specified date.

Unix epoch timestamp
Date & Time
Date & Time
Timezone: Africa/Abidjan
The programming language to get the timestamp value:
JavaScript

Math.round(new Date() / 1000)

Document

Python

import time;

time.time()

Document

Java

(int) (System.currentTimeMillis() / 1000)

Document

Go

import ( "time" )

int32(time.Now().Unix())

Document

C++

double now_time = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count();

Document

Swift

NSDate().timeIntervalSince1970

Document

MySQL

SELECT UNIX_TIMESTAMP(); #1567758868

SELECT FROM_UNIXTIME(1567758868); #2019-9-6 16:34:28

PHP

time()

Document

C#

DateTimeOffset.Now.ToUnixTimeSeconds()

Document

Ruby

Time.now.to_i

Document

Share to

Standard definition of date and time specifications

What is epoch timestamp?

UNIX time, or POSIX time, is the time representation used by UNIX or UNIX-like systems: the total number of seconds from 0:0:0:0 on January 1, 1970 UTC to the present, regardless of leap seconds.

Year 2038 problem

The earliest versions of Unix time were 32-bit integers increasing at 60 Hz. The first edition of the Unix Programmer's Manual, released on November 3, 1971, defined Unix time as "the time since 00:00:00, 1 January 1971, measured in sixtieths of a second", i.e. starting at 00:00:00, 1 January 1971, and increasing by 60 Hz. This means that storing Unix time as a 32-bit unsigned integer will run out of resets after 829 days (about 2.5 years). Because of this limitation, the Unix time origin was redefined several times until it began to use the time origin of January 1, 1970 at 00:00:00 UTC, timed at 1 Hz. Since Unix and C use 32-bit signed integers to represent time, this accommodates a time span of about 136 years, split 50/50 between before and after 1970. That is, until January 19, 2038 when the reset is exhausted.

Most systems using UNIX today are 32-bit, that is, they represent the time type time_t as a 32-bit signed integer. So it can represent seconds in 136 years. Represents Fri Dec 13, 1901 20:45:52 UTC to Jan 19, 2038 3:14:07 UTC (binary: 01111111 11111111 11111111 11111111, 0x7FFF:FFFF), in the next second the binary number will be 10000000 00000000 00000000 00000000 (0x8000:0000), this is a negative number, so systems will misinterpret the time as December 13, 1901, 20:45:52 (and possibly back to 1970). At this time, software problems may occur, resulting in system paralysis.

The current solution is to convert the system from a 32-bit to a 64-bit system. Under a 64-bit system, this time can be represented up to 292.2777702659 trillion 15:30:08 on December 4th.