3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "datetime: " . date('Y-m-d H:i:s Z') . "\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 Z', $date->format(DateTime::RFC2822) + 32400) . "\n"; echo "date now: " . date('Y-m-d H:i:s');
based on 2YQ85
Output for 7.1.0 - 7.2.0
datetime: 2016-01-07 22:43:13 3600 time: 1452202993 Warning: A non-numeric value encountered in /in/KRZlE on line 5 datetime with offset: 1970-01-01 10:00:00 3600 date now: 2016-01-07 22:43:13
Output for 5.6.28, 7.0.20
datetime: 2016-01-07 22:43:13 3600 time: 1452202993 datetime with offset: 1970-01-01 10:00:00 3600 date now: 2016-01-07 22:43:13
Output for 5.5.0 - 5.6.23, 7.0.0 - 7.0.6, 7.0.8
datetime: 2016-01-07 22:43:12 3600 time: 1452202992 datetime with offset: 1970-01-01 10:00:00 3600 date now: 2016-01-07 22:43:12
Output for 7.0.7
datetime: 2016-01-07 22:43:11 3600 time: 1452202991 datetime with offset: 1970-01-01 10:00:00 3600 date now: 2016-01-07 22:43:11