Timestamp to date

Using this tool you can easily convert timestamp to date as well as date to timestamp.

Date to unix timestamp

DayMonthYearHourMinuteSecondGMT

Friday , 30 September, 2016 19:29:46 | GMT (Time zone: UTC)

1475260186

Unix timestamp to date

What is unix timestamp?

Unix timestamp is the number of seconds since january 1, 1970 00:00:00 GMT.


How do we get timestamp in PHP?

Using strtotime() function we can get unix timestamp. it is also very important to note that strtotime() requires a default timezone otherwise it will generate timestamp in server timezone which could be misleading.

PHP Code Example:
<?php
// set default timezone
date_default_timezone_set('America/Los_Angeles');
//define date and time
$date date("d M Y H:i:s");
// output
echo strtotime($date);
?>
How do we get readable date from timestamp?

We can use date() function to generate readable date.

PHP Code Example:
<?php
// set default timezone
date_default_timezone_set('UTC');
//define unix timestamp
$timestamp 1456778973;
// output
echo date('d M Y H:i:s',$timestamp);
?>