3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if(date('j') === '1') { $to_date = date('Y-m-d' . ' 00:00:00', mktime(0, 0, 0, date("m") , date("d"), date("Y")));// $from_date = date('Y-m-01' . ' 00:00:00', mktime(0, 0, 0, date("m")-1 , date("d"), date("Y")));// } else { $to_date = date('Y-m-d' . ' 00:00:00', mktime(0, 0, 0, date("m") , date("d"), date("Y")));// $from_date = date('Y-m-01' . ' 00:00:00', mktime(0, 0, 0, date("m") , date("d"), date("Y")));// } echo $to_date; echo "<br/>"; echo $from_date;
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
2013-05-01 00:00:00<br/>2013-04-01 00:00:00