3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "datetime: " . date('Y-m-d H:i:s') . "\n"; echo "time: " . time() . "\n"; $date = DateTime::createFromFormat('Y-m-d H:i:s', '2016-01-07 22:28:34'); echo "datetime with offset: " . date('Y-m-d H:i:s', $date->format(\DateTime::RFC2822) + 32400) . "\n"; echo "date now: " . date('Y-m-d H:i:s');
based on hMcht
Output for 7.1.0 - 7.2.0
datetime: 2016-01-07 22:33:34 time: 1452202414 Warning: A non-numeric value encountered in /in/OdbIt on line 5 datetime with offset: 1970-01-01 10:00:00 date now: 2016-01-07 22:33:34
Output for 5.5.0 - 7.0.20
datetime: 2016-01-07 22:33:34 time: 1452202414 datetime with offset: 1970-01-01 10:00:00 date now: 2016-01-07 22:33:34