- date_default_timezone_set: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$date = '13-09-2010 00:00:00';
date_default_timezone_set('IST');
$etc = (strtotime($date) * 1000) - (strtotime('02-01-1970 00:00:00') * 1000);
echo $etc;
echo "\n---------------------------------------------------------------------\n";
$str = strtotime($date);
//Wed Oct 13 2010 05:30:00 GMT+0530
$ab = date("D M j Y G:i:s T", strtotime('02-01-1970 00:00:00'));
echo $ab;
echo "\n---------------------------------------------------------------------\n";
$datetime = new DateTime('Fri Jan 2 1970 0:00:00 UTC', new DateTimeZone('Asia/Calcutta'));
$datetime->setTimezone(new DateTimeZone('Asia/Calcutta'));
print $datetime->format('Y-m-d H:i:s (e)');
echo "\n---------------------------------------------------------------------\n";
$cur_time=date("Y-m-d H:i:s");
$curDate = '02-01-1970';
$duration='+5 minutes';
echo date('Y-m-d H:i:s', strtotime($duration, strtotime($curDate)));