3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $time=time(); $date = date("Y-m-d h:i:sa"); echo date_format($date,"Y/m/d H:i:s"); $d=mktime(14, 30, 00, date("d", $time), date("m", $time), date("Y", $time)); echo "<br />"."Created date is " . date("Y-m-d h:i:sa", $d); echo "<br />"."Current date is " . date("Y-m-d h:i:sa", $time); echo date_default_timezone_get(); $str_time = date("Y", $time)."-".date("m", $time)."-".date("d", $time)." 14:30:00"; echo $str_time; //echo "25-08-2011 17:30:30 = ".strtotime ("25-08-2011 17:30:30")." = ".date ("d-m-Y H:i:s", strtotime ("25-08-2011 17:30:30"))."<br>"; //echo "25-08-2011 17:31:17 = ".strtotime ("25-08-2011 17:31:17")." = ".date ("d-m-Y H:i:s", strtotime ("25-08-2011 17:31:17"))."<br>"; echo "====".date("H:i:s", strtotime ($str_time)-strtotime ($str_time))."===="; $localtime = localtime(); $localtime_assoc = localtime(time(), true); print_r($localtime); print_r($localtime_assoc);
based on M2MPb