3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function GetFormattedMicroTime($timestamp = false) { if(!$timestamp) $timestamp = microtime(true); return DateTime::createFromFormat('U.u',sprintf('%.f', $timestamp))->format('Y-m-d\TH:i:s.u'); } $microtime = microtime(true); print_r($microtime); $test = GetFormattedMicroTime(); print_r($test);
Output for 7.1.0
1403538246.00412014-06-23T15:44:06.004078
Output for 7.0.14
1403538246.00382014-06-23T15:44:06.003868
Output for 7.0.6
1462228294.81612016-05-02T22:31:34.816079
Output for 7.0.5
1459598695.71422016-04-02T12:04:55.714176
Output for 7.0.4
1457560956.5112016-03-09T22:02:36.511024
Output for 7.0.3
1458253657.19812016-03-17T22:27:37.198128
Output for 7.0.2
1458551418.35872016-03-21T09:10:18.358700
Output for 7.0.1
1458722972.93662016-03-23T08:49:32.936632
Output for 7.0.0
1458993251.88472016-03-26T11:54:11.884688
Output for hhvm-3.12.0
1457660477.42452016-03-11T01:41:17.424483
Output for hhvm-3.10.0
1459264394.19942016-03-29T15:13:14.199439
Output for 5.6.28
1403538246.00452014-06-23T15:44:06.004529
Output for 5.6.21
1462124226.21182016-05-01T17:37:06.211820
Output for 5.6.20
1460186426.59612016-04-09T07:20:26.596155
Output for 5.6.19
1457292458.90192016-03-06T19:27:38.901880
Output for 5.6.18
1457941911.51582016-03-14T07:51:51.515854
Output for 5.6.17
1458356588.36212016-03-19T03:03:08.362084
Output for 5.6.16
1459082307.52642016-03-27T12:38:27.526407
Output for 5.6.15
1459172235.84912016-03-28T13:37:15.849130
Output for 5.6.14
1459527549.49752016-04-01T16:19:09.497478
Output for 5.6.13
1460664964.9842016-04-14T20:16:04.983980
Output for 5.6.12
1461057593.68732016-04-19T09:19:53.687343
Output for 5.6.11
1461343080.81612016-04-22T16:38:00.816140
Output for 5.6.10
1461521788.28992016-04-24T18:16:28.289915
Output for 5.6.9
1461712865.2752016-04-26T23:21:05.274984
Output for 5.6.8
1461912914.60292016-04-29T06:55:14.602947
Output for 5.6.7
1464108329.29092016-05-24T16:45:29.290951
Output for 5.5.35
1463863833.82272016-05-21T20:50:33.822728
Output for 5.5.34
1460293057.72212016-04-10T12:57:37.722079
Output for 5.5.33
1457428459.78152016-03-08T09:14:19.781549
Output for 5.5.32
1458065766.72442016-03-15T18:16:06.724370
Output for 5.5.31
1458453447.16722016-03-20T05:57:27.167249
Output for 5.5.30
1459438902.95632016-03-31T15:41:42.956291
Output for 5.5.29
1460801930.63442016-04-16T10:18:50.634430
Output for 5.5.28
1461155377.86892016-04-20T12:29:37.868948
Output for 5.5.27
1461251346.59742016-04-21T15:09:06.597370
Output for 5.5.26
1461616259.40552016-04-25T20:30:59.405516
Output for 5.5.25
1461811076.64752016-04-28T02:37:56.647544
Output for 5.5.24
1462011406.68312016-04-30T10:16:46.683107
Output for 5.4.45
1442024552.79982015-09-12T02:22:32.800223
Output for 5.4.44
1442024550.43252015-09-12T02:22:30.432652
Output for 5.4.43
1442024547.20882015-09-12T02:22:27.208981
Output for 5.4.42
1436375404.83292015-07-08T17:10:04.833005
Output for 5.4.41
1432616566.36442015-05-26T05:02:46.364440
Output for 5.4.40
1430550655.04172015-05-02T07:10:55.041850
Output for 5.4.39
1430550654.25132015-05-02T07:10:54.251362
Output for 5.4.38
1425162312.422015-02-28T22:25:12.420067
Output for 5.4.37
1423203077.88732015-02-06T06:11:17.887361
Output for 5.4.36
1423203077.58432015-02-06T06:11:17.584311
Output for 5.4.35
1416118624.96382014-11-16T06:17:04.963828
Output for 5.4.34
1416118624.62712014-11-16T06:17:04.627178
Output for 5.4.32
1409804260.75962014-09-04T04:17:40.759668
Output for 5.4.31
1409804260.14452014-09-04T04:17:40.144558
Output for 5.4.30
1409804259.17872014-09-04T04:17:39.178762
Output for 5.4.29
1403538251.50222014-06-23T15:44:11.502251
Output for 5.4.28
1403538251.54822014-06-23T15:44:11.548277
Output for 5.4.27
1403538251.60322014-06-23T15:44:11.603223
Output for 5.4.26
1403538251.65522014-06-23T15:44:11.655289
Output for 5.4.25
1403538251.7292014-06-23T15:44:11.729044
Output for 5.4.24
1403538251.78962014-06-23T15:44:11.789642
Output for 5.4.23
1403538251.84052014-06-23T15:44:11.840526
Output for 5.4.22
1403538251.88962014-06-23T15:44:11.889672
Output for 5.4.21
1403538251.98862014-06-23T15:44:11.988646
Output for 5.4.20
1403538252.07192014-06-23T15:44:12.072005
Output for 5.4.19
1403538252.15492014-06-23T15:44:12.154924
Output for 5.4.18
1403538252.21692014-06-23T15:44:12.216986
Output for 5.4.17
1403538252.26722014-06-23T15:44:12.267242
Output for 5.4.16
1403538252.31772014-06-23T15:44:12.317729
Output for 5.4.15
1403538252.3652014-06-23T15:44:12.365074
Output for 5.4.14
1403538252.42252014-06-23T15:44:12.422569
Output for 5.4.13
1403538252.4812014-06-23T15:44:12.481091
Output for 5.4.12
1403538252.56632014-06-23T15:44:12.566332
Output for 5.4.11
1403538252.63952014-06-23T15:44:12.639601
Output for 5.4.10
1403538252.76972014-06-23T15:44:12.769815
Output for 5.4.9
1403538252.82312014-06-23T15:44:12.823163
Output for 5.4.8
1403538252.87632014-06-23T15:44:12.876318
Output for 5.4.7
1403538252.93112014-06-23T15:44:12.931152
Output for 5.4.6
1403538253.00172014-06-23T15:44:13.001742
Output for 5.4.5
1403538253.08882014-06-23T15:44:13.088899
Output for 5.4.4
1403538253.14882014-06-23T15:44:13.148880
Output for 5.4.3
1403538253.21832014-06-23T15:44:13.219020
Output for 5.4.2
1403538253.28612014-06-23T15:44:13.286187
Output for 5.4.1
1403538253.41012014-06-23T15:44:13.410163
Output for 5.4.0
1403538253.46042014-06-23T15:44:13.460471
Output for 5.3.29
1409804259.33052014-09-04T04:17:39.330516
Output for 5.3.28
1403538253.51642014-06-23T15:44:13.516466
Output for 5.3.27
1403538253.5852014-06-23T15:44:13.585102
Output for 5.3.26
1403538253.63582014-06-23T15:44:13.635865
Output for 5.3.25
1403538253.7042014-06-23T15:44:13.704132
Output for 5.3.24
1403538253.7552014-06-23T15:44:13.755038
Output for 5.3.23
1403538253.80732014-06-23T15:44:13.807326
Output for 5.3.22
1403538253.85672014-06-23T15:44:13.856737
Output for 5.3.21
1403538253.90772014-06-23T15:44:13.907783
Output for 5.3.20
1403538253.95672014-06-23T15:44:13.956757
Output for 5.3.19
1403538254.00712014-06-23T15:44:14.007118
Output for 5.3.18
1403538254.05372014-06-23T15:44:14.053753
Output for 5.3.17
1403538254.09992014-06-23T15:44:14.099972
Output for 5.3.16
1403538254.16752014-06-23T15:44:14.167614
Output for 5.3.15
1403538254.24022014-06-23T15:44:14.240251
Output for 5.3.14
1403538254.29822014-06-23T15:44:14.298316
Output for 5.3.13
1403538254.34882014-06-23T15:44:14.348828
Output for 5.3.12
1403538254.39722014-06-23T15:44:14.397307
Output for 5.3.11
1403538254.44772014-06-23T15:44:14.447786
Output for 5.3.10
1403538254.49652014-06-23T15:44:14.496555
Output for 5.3.9
1403538254.54182014-06-23T15:44:14.541897
Output for 5.3.8
1403538254.58852014-06-23T15:44:14.588578
Output for 5.3.7
1403538254.63472014-06-23T15:44:14.634760
Output for 5.3.6
1403538254.67942014-06-23T15:44:14.679449
Output for 5.3.5
1403538254.72362014-06-23T15:44:14.723713
Output for 5.3.4
1403538254.76922014-06-23T15:44:14.769240
Output for 5.3.3
1403538254.81812014-06-23T15:44:14.818203
Output for 5.3.2
1403538254.86392014-06-23T15:44:14.863916
Output for 5.3.1
1403538254.91112014-06-23T15:44:14.911207
Output for 5.3.0
1403538254.9603 Fatal error: Call to a member function format() on a non-object in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.17
1403538255.0122 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.16
1403538255.1442 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.15
1403538255.1983 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.14
1403538255.2525 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.13
1403538255.3035 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.12
1403538255.3877 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.11
1403538255.4371 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.10
1403538255.4873 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.9
1403538255.526 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.8
1403538255.565 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.7
1403538255.6027 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.6
1403538255.6396 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.5
1403538255.6793 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.4
1403538255.7158 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.3
1403538255.7542 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.2
1403538255.7907 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.1
1403538255.826 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.2.0
1403538255.8635 Fatal error: Call to undefined method DateTime::createfromformat() in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.1.6
1403538255.8959 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.1.5
1403538255.928 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.1.4
1403538255.9597 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.1.3
1403538255.9947 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.1.2
1403538256.0294 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.1.1
1403538256.063 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.1.0
1403538256.0962 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.0.5
1403538256.1247 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.0.4
1403538256.1513 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.0.3
1403538256.1967 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.0.2
1403538256.2634 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.0.1
1403538256.2913 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 5.0.0
1403538256.3347 Fatal error: Class 'DateTime' not found in /in/OSPEn on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/OSPEn on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/OSPEn on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/OSPEn on line 5
Process exited with code 255.