- date_diff: documentation ( source)
- var_dump: documentation ( source)
- date: documentation ( source)
<?php
$date1 = new \DateTime('2015-05-01 20:41:28');
$date2 = new \DateTime('2015-05-03 17:41:28');
$diff = date_diff($date1, $date2)->format('%R%a days');
$timestamp = $date1->getTimestamp();
$timestamp = $timestamp - ($timestamp % 60);
var_dump($timestamp);
echo date('m/d/Y s', $timestamp);
var_dump($date1->getTimestamp());
echo date('m/d/Y s', $date1->getTimestamp());