@ 2015-11-05T22:22:02Z <?php
$datetimes = [
'2014-10-05T01:59:59',
'2014-10-05T02:00:00',
'2014-10-05T02:59:59',
'2014-10-05T03:00:00'
];
foreach ($datetimes as $datetime) {
$dt = new DateTime($datetime, new DateTimeZone('Australia/Sydney'));
echo $dt;
echo $dt->format(DateTime::ISO8601) . PHP_EOL;
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.6 Fatal error: Uncaught Error: Object of class DateTime could not be converted to string in /in/Kt98p:11
Stack trace:
#0 {main}
thrown in /in/Kt98p on line 11
Process exited with code 255 . Output for 7.1.0 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 Recoverable fatal error: Object of class DateTime could not be converted to string in /in/Kt98p on line 11
Process exited with code 255 . Output for 5.5.24 - 5.5.35 , 5.6.8 - 5.6.28 , 7.0.0 - 7.0.20 Catchable fatal error: Object of class DateTime could not be converted to string in /in/Kt98p on line 11
Process exited with code 255 . preferences:dark mode live preview
183.49 ms | 402 KiB | 213 Q