3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime(); $dstr = $dt->format('Y-m-d H:i:s.u'); $darr = explode(".", $dstr) ; $darr[1] = sprintf("%06d", mt_rand(0, 999999)) ; $dstr = implode(".", $darr) ; echo $dstr . "\n"; $dn = DateTime::createFromFormat('Y-m-d H:i:s.u', $dstr); echo $dn->format('U.u') . "\n";
Output for 7.1.0
2014-05-23 12:28:14.161035 1400840894.161035
Output for 7.0.14
2014-05-23 12:28:14.110275 1400840894.110275
Output for 7.0.8
2013-10-08 12:24:30.499960 1381227870.499960
Output for 7.0.7
2013-10-08 12:24:30.550257 1381227870.550257
Output for 7.0.6
2013-10-08 12:24:30.277204 1381227870.277204
Output for 7.0.5
2013-10-08 12:24:30.815456 1381227870.815456
Output for 7.0.4
2013-10-08 12:24:30.999006 1381227870.999006
Output for 7.0.3
2013-10-08 12:24:30.452126 1381227870.452126
Output for 7.0.2
2013-10-08 12:24:30.568011 1381227870.568011
Output for 7.0.1
2013-10-08 12:24:30.586550 1381227870.586550
Output for 7.0.0
2013-10-08 12:24:30.085442 1381227870.085442
Output for hhvm-3.12.0
2013-10-08 12:24:30.973492 1381227870.973492
Output for hhvm-3.10.0
2013-10-08 12:24:30.610244 1381227870.610244
Output for 5.6.28
2014-05-23 12:28:14.135536 1400840894.135536
Output for 5.6.23
2013-10-08 12:24:30.088318 1381227870.088318
Output for 5.6.22
2013-10-08 12:24:30.110151 1381227870.110151
Output for 5.6.21
2013-10-08 12:24:30.776576 1381227870.776576
Output for 5.6.20
2013-10-08 12:24:30.476653 1381227870.476653
Output for 5.6.19
2013-10-08 12:24:30.257283 1381227870.257283
Output for 5.6.18
2013-10-08 12:24:30.191992 1381227870.191992
Output for 5.6.17
2013-10-08 12:24:30.157505 1381227870.157505
Output for 5.6.16
2013-10-08 12:24:30.778576 1381227870.778576
Output for 5.6.15
2013-10-08 12:24:30.289021 1381227870.289021
Output for 5.6.14
2013-10-08 12:24:30.907144 1381227870.907144
Output for 5.6.13
2013-10-08 12:24:30.834353 1381227870.834353
Output for 5.6.12
2013-10-08 12:24:30.438758 1381227870.438758
Output for 5.6.11
2013-10-08 12:24:30.501344 1381227870.501344
Output for 5.6.10
2013-10-08 12:24:30.008616 1381227870.008616
Output for 5.6.9
2013-10-08 12:24:30.768179 1381227870.768179
Output for 5.6.8
2013-10-08 12:24:30.824946 1381227870.824946
Output for 5.6.7
2013-10-08 12:24:30.668132 1381227870.668132
Output for 5.6.6
2013-10-08 12:24:30.070968 1381227870.070968
Output for 5.6.5
2013-10-08 12:24:30.838589 1381227870.838589
Output for 5.6.4
2013-10-08 12:24:30.033644 1381227870.033644
Output for 5.6.3
2013-10-08 12:24:30.944822 1381227870.944822
Output for 5.6.2
2013-10-08 12:24:30.694168 1381227870.694168
Output for 5.6.1
2013-10-08 12:24:30.678334 1381227870.678334
Output for 5.6.0
2013-10-08 12:24:30.831952 1381227870.831952
Output for 5.5.37
2013-10-08 12:24:30.373235 1381227870.373235
Output for 5.5.36
2013-10-08 12:24:30.765826 1381227870.765826
Output for 5.5.35
2013-10-08 12:24:30.112361 1381227870.112361
Output for 5.5.34
2013-10-08 12:24:30.281495 1381227870.281495
Output for 5.5.33
2013-10-08 12:24:30.829511 1381227870.829511
Output for 5.5.32
2013-10-08 12:24:30.729123 1381227870.729123
Output for 5.5.31
2013-10-08 12:24:30.937233 1381227870.937233
Output for 5.5.30
2013-10-08 12:24:30.893953 1381227870.893953
Output for 5.5.29
2013-10-08 12:24:30.334365 1381227870.334365
Output for 5.5.28
2013-10-08 12:24:30.513424 1381227870.513424
Output for 5.5.27
2013-10-08 12:24:30.596055 1381227870.596055
Output for 5.5.26
2013-10-08 12:24:30.157144 1381227870.157144
Output for 5.5.25
2013-10-08 12:24:30.898737 1381227870.898737
Output for 5.5.24
2013-10-08 12:24:30.393628 1381227870.393628
Output for 5.5.23
2013-10-08 12:24:30.553570 1381227870.553570
Output for 5.5.22
2013-10-08 12:24:30.592903 1381227870.592903
Output for 5.5.21
2013-10-08 12:24:30.215769 1381227870.215769
Output for 5.5.20
2013-10-08 12:24:30.504932 1381227870.504932
Output for 5.5.19
2013-10-08 12:24:30.649666 1381227870.649666
Output for 5.5.18
2013-10-08 12:24:30.127980 1381227870.127980
Output for 5.5.16
2013-10-08 12:24:30.277967 1381227870.277967
Output for 5.5.15
2013-10-08 12:24:30.606752 1381227870.606752
Output for 5.5.14
2013-10-08 12:24:30.378699 1381227870.378699
Output for 5.5.13
2013-10-08 12:24:30.047847 1381227870.047847
Output for 5.5.12
2013-10-08 12:24:30.185871 1381227870.185871
Output for 5.5.11
2013-10-08 12:24:30.137324 1381227870.137324
Output for 5.5.10
2013-10-08 12:24:30.621671 1381227870.621671
Output for 5.5.9
2013-10-08 12:24:30.902578 1381227870.902578
Output for 5.5.8
2013-10-08 12:24:30.585151 1381227870.585151
Output for 5.5.7
2013-10-08 12:24:30.872608 1381227870.872608
Output for 5.5.6
2013-10-08 12:24:30.008107 1381227870.008107
Output for 5.5.5
2013-10-08 12:24:30.469430 1381227870.469430
Output for 5.5.4
2013-10-08 12:24:30.747533 1381227870.747533
Output for 5.5.3
2013-10-08 12:24:30.029984 1381227870.029984
Output for 5.5.2
2013-10-08 12:24:30.761541 1381227870.761541
Output for 5.5.1
2013-10-08 12:24:30.515093 1381227870.515093
Output for 5.5.0
2013-10-08 12:24:30.743824 1381227870.743824
Output for 5.4.45
2013-10-08 12:24:30.930870 1381227870.930870
Output for 5.4.44
2013-10-08 12:24:30.145370 1381227870.145370
Output for 5.4.43
2013-10-08 12:24:30.753524 1381227870.753524
Output for 5.4.42
2013-10-08 12:24:30.623827 1381227870.623827
Output for 5.4.41
2013-10-08 12:24:30.577346 1381227870.577346
Output for 5.4.40
2013-10-08 12:24:30.720417 1381227870.720417
Output for 5.4.39
2013-10-08 12:24:30.321560 1381227870.321560
Output for 5.4.38
2013-10-08 12:24:30.950075 1381227870.950075
Output for 5.4.37
2013-10-08 12:24:30.896184 1381227870.896184
Output for 5.4.36
2013-10-08 12:24:30.637141 1381227870.637141
Output for 5.4.35
2013-10-08 12:24:30.460138 1381227870.460138
Output for 5.4.34
2013-10-08 12:24:30.150563 1381227870.150563
Output for 5.4.32
2013-10-08 12:24:30.240024 1381227870.240024
Output for 5.4.31
2013-10-08 12:24:30.970085 1381227870.970085
Output for 5.4.30
2013-10-08 12:24:30.050355 1381227870.050355
Output for 5.4.29
2013-10-08 12:24:30.633391 1381227870.633391
Output for 5.4.28
2013-10-08 12:24:30.124782 1381227870.124782
Output for 5.4.27
2013-10-08 12:24:30.370611 1381227870.370611
Output for 5.4.26
2013-10-08 12:24:30.931941 1381227870.931941
Output for 5.4.25
2013-10-08 12:24:30.595388 1381227870.595388
Output for 5.4.24
2013-10-08 12:24:30.053822 1381227870.053822
Output for 5.4.23
2013-10-08 12:24:30.806630 1381227870.806630
Output for 5.4.22
2013-10-08 12:24:30.176704 1381227870.176704
Output for 5.4.21
2013-10-08 12:24:30.061021 1381227870.061021
Output for 5.4.20
2013-10-08 12:24:30.481733 1381227870.481733
Output for 5.4.19
2013-10-08 12:24:30.531200 1381227870.531200
Output for 5.4.18
2013-10-08 12:24:30.683728 1381227870.683728
Output for 5.4.17
2013-10-08 12:24:30.317067 1381227870.317067
Output for 5.4.16
2013-10-08 12:24:30.371688 1381227870.371688
Output for 5.4.15
2013-10-08 12:24:30.092112 1381227870.092112
Output for 5.4.14
2013-10-08 12:24:30.541325 1381227870.541325
Output for 5.4.13
2013-10-08 12:24:30.809478 1381227870.809478
Output for 5.4.12
2013-10-08 12:24:30.479452 1381227870.479452
Output for 5.4.11
2013-10-08 12:24:30.682178 1381227870.682178
Output for 5.4.10
2013-10-08 12:24:30.188667 1381227870.188667
Output for 5.4.9
2013-10-08 12:24:30.786940 1381227870.786940
Output for 5.4.8
2013-10-08 12:24:30.086747 1381227870.086747
Output for 5.4.7
2013-10-08 12:24:30.940070 1381227870.940070
Output for 5.4.6
2013-10-08 12:24:30.888451 1381227870.888451
Output for 5.4.5
2013-10-08 12:24:30.393962 1381227870.393962
Output for 5.4.4
2013-10-08 12:24:30.633384 1381227870.633384
Output for 5.4.3
2013-10-08 12:24:30.332558 1381227870.332558
Output for 5.4.2
2013-10-08 12:24:30.444197 1381227870.444197
Output for 5.4.1
2013-10-08 12:24:30.928494 1381227870.928494
Output for 5.4.0
2013-10-08 12:24:30.888708 1381227870.888708
Output for 5.3.29
2013-10-08 12:24:30.130374 1381227870.130374
Output for 5.3.28
2013-10-08 12:24:30.086143 1381227870.086143
Output for 5.3.27
2013-10-08 12:24:30.733559 1381227870.733559
Output for 5.3.26
2013-10-08 12:24:30.176322 1381227870.176322
Output for 5.3.25
2013-10-08 12:24:30.863666 1381227870.863666
Output for 5.3.24
2013-10-08 12:24:30.177771 1381227870.177771
Output for 5.3.23
2013-10-08 12:24:30.877947 1381227870.877947
Output for 5.3.22
2013-10-08 12:24:30.124892 1381227870.124892
Output for 5.3.21
2013-10-08 12:24:30.188196 1381227870.188196
Output for 5.3.20
2013-10-08 12:24:30.503898 1381227870.503898
Output for 5.3.19
2013-10-08 12:24:30.674026 1381227870.674026
Output for 5.3.18
2013-10-08 12:24:30.392723 1381227870.392723
Output for 5.3.17
2013-10-08 12:24:30.671766 1381227870.671766
Output for 5.3.16
2013-10-08 12:24:30.176235 1381227870.176235
Output for 5.3.15
2013-10-08 12:24:30.063673 1381227870.063672
Output for 5.3.14
2013-10-08 12:24:30.075587 1381227870.075587
Output for 5.3.13
2013-10-08 12:24:30.052566 1381227870.052566
Output for 5.3.12
2013-10-08 12:24:30.048149 1381227870.048149
Output for 5.3.11
2013-10-08 12:24:30.892774 1381227870.892774
Output for 5.3.10
2013-10-08 12:24:30.313739 1381227870.313739
Output for 5.3.9
2013-10-08 12:24:30.516914 1381227870.516914
Output for 5.3.8
2013-10-08 12:24:30.700517 1381227870.700517
Output for 5.3.7
2013-10-08 12:24:30.715244 1381227870.715244
Output for 5.3.6
2013-10-08 12:24:30.154669 1381227870.154669
Output for 5.3.5
2013-10-08 12:24:30.506981 1381227870.506981
Output for 5.3.4
2013-10-08 12:24:30.863695 1381227870.863695
Output for 5.3.3
2013-10-08 12:24:30.861722 1381227870.861722
Output for 5.3.2
2013-10-08 12:24:30.348702 1381227870.348702
Output for 5.3.1
2013-10-08 12:24:30.261974 1381227870.261973
Output for 5.3.0
2013-10-08 12:24:30.808727 Fatal error: Call to a member function format() on a non-object in /in/OQXfq on line 9
Process exited with code 255.
Output for 5.2.17
2013-10-08 12:24:30.420120 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.16
2013-10-08 12:24:30.303882 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.15
2013-10-08 12:24:30.391081 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.14
2013-10-08 12:24:30.601058 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.13
2013-10-08 12:24:30.873289 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.12
2013-10-08 12:24:30.469936 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.11
2013-10-08 12:24:30.430060 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.10
2013-10-08 12:24:30.079714 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.9
2013-10-08 12:24:30.687103 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.8
2013-10-08 12:24:30.650169 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.7
2013-10-08 12:24:30.872271 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.6
2013-10-08 12:24:30.897126 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.5
2013-10-08 12:24:30.589439 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.4
2013-10-08 12:24:30.198779 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.3
2013-10-08 12:24:30.156241 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.2
2013-10-08 12:24:30.805387 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.1
2013-10-08 12:24:30.952171 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.2.0
2013-10-08 12:24:30.626355 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OQXfq on line 8
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/OQXfq on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/OQXfq on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/OQXfq on line 2