3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d = 1450283411; echo "Midnight of $d\n"; $date = new DateTime(); $date->setTimestamp($d); $date->setTime(0,0,0); echo $date->format('Y-m-d, H:i:s'); echo "\nor\n"; echo date( floor($d/86400)*86400,'Y-m-d H:i:s');
based on QCfLP
Output for 7.0.0 - 7.2.0
Midnight of 1450283411 2015-12-16, 00:00:00 or Warning: date() expects parameter 2 to be integer, string given in /in/ZKTVM on line 11
Output for 5.5.0 - 5.6.28
Midnight of 1450283411 2015-12-16, 00:00:00 or Warning: date() expects parameter 2 to be long, string given in /in/ZKTVM on line 11