3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Oslo'); $datetime = new DateTime(); echo $datetime->format('Y-m-d H:i:s.u')."\n"; $datetime = new DateTime('2016-08-07T11:59:12.345'); echo $datetime->format('Y-m-d H:i:s.u')."\n";
based on R3G9h
Output for 8.0.3
2016-08-07 11:59:51.012701 2016-08-07 11:59:12.345000
Output for 8.0.2
2016-08-07 11:59:51.008754 2016-08-07 11:59:12.345000
Output for 8.0.0
2016-08-07 11:59:51.008482 2016-08-07 11:59:12.345000
Output for 7.4.16
2016-08-07 11:59:51.007833 2016-08-07 11:59:12.345000
Output for 7.4.15
2016-08-07 11:59:51.008636 2016-08-07 11:59:12.345000
Output for 7.4.14
2016-08-07 11:59:51.009581 2016-08-07 11:59:12.345000
Output for 7.4.13
2016-08-07 11:59:51.009102 2016-08-07 11:59:12.345000
Output for 7.4.12
2016-08-07 11:59:51.009204 2016-08-07 11:59:12.345000
Output for 7.4.11
2016-08-07 11:59:51.012369 2016-08-07 11:59:12.345000
Output for 7.4.10
2016-08-07 11:59:51.008293 2016-08-07 11:59:12.345000
Output for 7.4.9
2016-08-07 11:59:51.009583 2016-08-07 11:59:12.345000
Output for 7.4.8
2016-08-07 11:59:51.008484 2016-08-07 11:59:12.345000
Output for 7.4.7
2016-08-07 11:59:51.009355 2016-08-07 11:59:12.345000
Output for 7.4.6
2016-08-07 11:59:51.000307 2016-08-07 11:59:12.345000
Output for 7.4.5
2016-08-07 11:59:51.003293 2016-08-07 11:59:12.345000
Output for 7.4.4
2016-08-07 11:59:51.008128 2016-08-07 11:59:12.345000
Output for 7.4.3
2016-08-07 11:59:51.008287 2016-08-07 11:59:12.345000
Output for 7.4.0
2016-08-07 11:59:51.000222 2016-08-07 11:59:12.345000
Output for 7.3.28
2016-08-07 11:59:51.007663 2016-08-07 11:59:12.345000
Output for 7.3.27
2016-08-07 11:59:51.008542 2016-08-07 11:59:12.345000
Output for 7.3.26
2016-08-07 11:59:51.012505 2016-08-07 11:59:12.345000
Output for 7.3.25
2016-08-07 11:59:51.011382 2016-08-07 11:59:12.345000
Output for 7.3.24
2016-08-07 11:59:51.009203 2016-08-07 11:59:12.345000
Output for 7.3.23
2016-08-07 11:59:51.008361 2016-08-07 11:59:12.345000
Output for 7.3.21
2016-08-07 11:59:51.008291 2016-08-07 11:59:12.345000
Output for 7.3.20
2016-08-07 11:59:51.008310 2016-08-07 11:59:12.345000
Output for 7.3.19
2016-08-07 11:59:51.008547 2016-08-07 11:59:12.345000
Output for 7.3.18
2016-08-07 11:59:51.005680 2016-08-07 11:59:12.345000
Output for 7.3.17
2016-08-07 11:59:51.008934 2016-08-07 11:59:12.345000
Output for 7.3.16
2016-08-07 11:59:51.011445 2016-08-07 11:59:12.345000
Output for 7.3.12
2016-08-07 11:59:51.000223 2016-08-07 11:59:12.345000
Output for 7.3.11
2016-08-07 11:59:51.000175 2016-08-07 11:59:12.345000
Output for 7.3.10
2016-08-07 11:59:51.000173 2016-08-07 11:59:12.345000
Output for 7.3.9
2016-08-07 11:59:51.000256 2016-08-07 11:59:12.345000
Output for 7.3.8
2016-08-07 11:59:51.000261 2016-08-07 11:59:12.345000
Output for 7.3.7
2016-08-07 11:59:51.000182 2016-08-07 11:59:12.345000
Output for 7.3.6
2016-08-07 11:59:51.000144 2016-08-07 11:59:12.345000
Output for 7.3.5
2016-08-07 11:59:51.000186 2016-08-07 11:59:12.345000
Output for 7.3.4
2016-08-07 11:59:51.000149 2016-08-07 11:59:12.345000
Output for 7.3.3
2016-08-07 11:59:51.000277 2016-08-07 11:59:12.345000
Output for 7.3.2
2016-08-07 11:59:51.000128 2016-08-07 11:59:12.345000
Output for 7.3.1
2016-08-07 11:59:51.000192 2016-08-07 11:59:12.345000
Output for 7.3.0
2016-08-07 11:59:51.000109 2016-08-07 11:59:12.345000
Output for 7.2.33
2016-08-07 11:59:51.009746 2016-08-07 11:59:12.345000
Output for 7.2.32
2016-08-07 11:59:51.011837 2016-08-07 11:59:12.345000
Output for 7.2.31
2016-08-07 11:59:51.008211 2016-08-07 11:59:12.345000
Output for 7.2.30
2016-08-07 11:59:51.008297 2016-08-07 11:59:12.345000
Output for 7.2.29
2016-08-07 11:59:51.008392 2016-08-07 11:59:12.345000
Output for 7.2.25
2016-08-07 11:59:51.000220 2016-08-07 11:59:12.345000
Output for 7.2.24
2016-08-07 11:59:51.000167 2016-08-07 11:59:12.345000
Output for 7.2.23
2016-08-07 11:59:51.000150 2016-08-07 11:59:12.345000
Output for 7.2.22
2016-08-07 11:59:51.000153 2016-08-07 11:59:12.345000
Output for 7.2.21
2016-08-07 11:59:51.000177 2016-08-07 11:59:12.345000
Output for 7.2.20
2016-08-07 11:59:51.000193 2016-08-07 11:59:12.345000
Output for 7.2.19
2016-08-07 11:59:51.000168 2016-08-07 11:59:12.345000
Output for 7.2.18
2016-08-07 11:59:51.000174 2016-08-07 11:59:12.345000
Output for 7.2.17
2016-08-07 11:59:51.000199 2016-08-07 11:59:12.345000
Output for 7.2.6
2016-08-07 11:59:51.002272 2016-08-07 11:59:12.345000
Output for 7.2.0
2016-08-07 11:59:51.003645 2016-08-07 11:59:12.345000
Output for 7.1.33
2016-08-07 11:59:51.000189 2016-08-07 11:59:12.345000
Output for 7.1.32
2016-08-07 11:59:51.000111 2016-08-07 11:59:12.345000
Output for 7.1.31
2016-08-07 11:59:51.000151 2016-08-07 11:59:12.345000
Output for 7.1.30
2016-08-07 11:59:51.000191 2016-08-07 11:59:12.345000
Output for 7.1.29
2016-08-07 11:59:51.000170 2016-08-07 11:59:12.345000
Output for 7.1.28
2016-08-07 11:59:51.000187 2016-08-07 11:59:12.345000
Output for 7.1.26 - 7.1.27
2016-08-07 11:59:51.000119 2016-08-07 11:59:12.345000
Output for 7.1.20
2016-08-07 11:59:51.002860 2016-08-07 11:59:12.345000
Output for 7.1.10
2016-08-07 11:59:51.003930 2016-08-07 11:59:12.345000
Output for 7.1.7
2016-08-07 11:59:51.005203 2016-08-07 11:59:12.345000
Output for 7.1.6
2016-08-07 11:59:51.005524 2016-08-07 11:59:12.345000
Output for 7.1.5
2016-08-07 11:59:51.012746 2016-08-07 11:59:12.345000
Output for 7.1.0
2016-08-07 11:59:51.003989 2016-08-07 11:59:12.345000
Output for 5.6.0 - 5.6.24, 7.0.0 - 7.0.20
2016-08-07 11:59:51.000000 2016-08-07 11:59:12.345000