3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set ("UTC"); $date = DateTime::createFromFormat('U.u', microtime(true)); print_r($date); $current_time = $date->format('Y-m-d H:i:s'); echo $current_time; ?>
based on HQZ2v
Output for 7.2.6
DateTime Object ( [date] => 2017-07-06 09:44:23.003600 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.2.0
DateTime Object ( [date] => 2017-07-06 09:44:23.004200 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.1.10
DateTime Object ( [date] => 2017-07-06 09:44:23.002800 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.0.1, 7.1.7
DateTime Object ( [date] => 2017-07-06 09:44:23.006000 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.1.6
DateTime Object ( [date] => 2017-07-06 09:44:23.021200 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.1.5
DateTime Object ( [date] => 2017-07-06 09:44:23.018200 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.1.4
DateTime Object ( [date] => 2017-07-06 09:44:23.018000 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.1.3
DateTime Object ( [date] => 2017-07-06 09:44:23.016100 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.1.2
DateTime Object ( [date] => 2017-07-06 09:44:23.020500 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.12, 7.0.16, 7.1.0 - 7.1.1
DateTime Object ( [date] => 2017-07-06 09:44:23.006300 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.0.20
DateTime Object ( [date] => 2017-07-06 09:44:23.008500 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.0.19
DateTime Object ( [date] => 2017-07-06 09:44:23.009000 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.0.18
DateTime Object ( [date] => 2017-07-06 09:44:23.011000 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.0.17
DateTime Object ( [date] => 2017-07-06 09:44:23.007400 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.0.7, 7.0.15
DateTime Object ( [date] => 2017-07-06 09:44:23.004500 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.29 - 5.6.30, 7.0.12, 7.0.14
DateTime Object ( [date] => 2017-07-06 09:44:23.006200 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.5, 5.6.7, 7.0.13
DateTime Object ( [date] => 2017-07-06 09:44:23.006800 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.22, 7.0.11
DateTime Object ( [date] => 2017-07-06 09:44:23.007100 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.0.2, 7.0.10
DateTime Object ( [date] => 2017-07-06 09:44:23.006600 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.0.6, 7.0.9
DateTime Object ( [date] => 2017-07-06 09:44:23.004700 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.0.8
DateTime Object ( [date] => 2017-07-06 09:44:23.005300 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.0.5
DateTime Object ( [date] => 2017-07-06 09:44:23.004900 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 7.0.4
DateTime Object ( [date] => 2017-07-06 09:44:23.029000 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.18, 7.0.3
DateTime Object ( [date] => 2017-07-06 09:44:23.007300 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.23, 7.0.0
DateTime Object ( [date] => 2017-07-06 09:44:23.005400 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for hhvm-3.15.4
DateTime Object ( [date] => 2017-07-06 09:44:23.239900 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.6, 5.6.16, 5.6.27 - 5.6.28
DateTime Object ( [date] => 2017-07-06 09:44:23.006900 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.26
DateTime Object ( [date] => 2017-07-06 09:44:23.008700 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.1, 5.6.4, 5.6.21, 5.6.25
DateTime Object ( [date] => 2017-07-06 09:44:23.005100 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.24
DateTime Object ( [date] => 2017-07-06 09:44:23.005500 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.0, 5.6.10, 5.6.20
DateTime Object ( [date] => 2017-07-06 09:44:23.005000 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.19
DateTime Object ( [date] => 2017-07-06 09:44:23.005200 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.17
DateTime Object ( [date] => 2017-07-06 09:44:23.007900 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.13 - 5.6.15
DateTime Object ( [date] => 2017-07-06 09:44:23.007000 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.11
DateTime Object ( [date] => 2017-07-06 09:44:23.008600 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.9
DateTime Object ( [date] => 2017-07-06 09:44:23.007600 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.8
DateTime Object ( [date] => 2017-07-06 09:44:23.007700 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.3
DateTime Object ( [date] => 2017-07-06 09:44:23.006400 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23
Output for 5.6.2
DateTime Object ( [date] => 2017-07-06 09:44:23.004800 [timezone_type] => 1 [timezone] => +00:00 ) 2017-07-06 09:44:23