Current timestamp: 1498628135

Convert timestamp

Convert date

Timestamp to Date Examples

PHP
date("Y-m-d H:i:s", 1498628135);
JavaScript
new Date(1.498628135E+12).toLocaleString();
Python
new Date(1498628135).toLocaleString();
Java
import Java.Util.Date;
import java.text.SimpleDateFormat;
Date currentDate = new Date (1.498628135E+12)
SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss")
String date = dateFormat.format(currentDate);

Date to Timestamp Examples

PHP
strtotime("2017-06-28 07::35:35");
JavaScript
Date.parse("2017-06-28 07::35:35")/1000;
Python
import time
int(time.mktime(time.strptime("2017-06-28 07::35:35"))) - time.timezone
Java
import java.text.SimpleDateFormat;
SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss")
long ts = dateFormat.parse(2017-06-28 07::35:35).getTime()/1000;

Current Timestamp Examples

PHP
time();
JavaScript
new Date().getTime()/1000;
Python
import time;
time.time()
Java
long ts = System.currentTimeMillis()/1000;

Unix Time

Unix time (also known as POSIX time or Epoch time) is a system for describing instants in time, defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, not counting leap seconds. It is used widely in Unix-like and many other operating systems and file formats. Because it does not handle leap seconds, it is neither a linear representation of time nor a true representation of UTC.

Examples for: php | javascript | python | java