- floor: documentation ( source)
- date_default_timezone_set: documentation ( source)
- strtotime: documentation ( source)
<?php
date_default_timezone_set('Europe/Prague');
$start = strtotime('1900-01-01 00:00:00');
$dates = array('2013-01-01 00:01:59', '2013-01-03 11:12:05', '2012-10-28 23:07:06');
foreach ($dates as $d) {
$timestamp = strtotime($d);
$diff = $timestamp - $start;
$daysDiff = floor($diff/(60*60*24));
$dateFact = $daysDiff + 1;
echo $diff - ($daysDiff * 60*60*24).PHP_EOL;
echo $dateFact.PHP_EOL.PHP_EOL;
}