<?php
$dt = new DateTime(
'2017-05-16T10:11:32',
new DateTimeZone('CEST')
);
var_dump($dt);
var_dump($dt->format('c'));
- Output for 8.0.21 - 8.0.30, 8.1.8 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- object(DateTime)#1 (3) {
["date"]=>
string(26) "2017-05-16 10:11:32.000000"
["timezone_type"]=>
int(2)
["timezone"]=>
string(4) "CEST"
}
string(25) "2017-05-16T10:11:32+02:00"
- Output for 5.6.38 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.30, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.20, 8.1.0 - 8.1.7
- object(DateTime)#1 (3) {
["date"]=>
string(26) "2017-05-16 10:11:32.000000"
["timezone_type"]=>
int(2)
["timezone"]=>
string(4) "CEST"
}
string(25) "2017-05-16T10:11:32+01:00"
preferences:
148.37 ms | 409 KiB | 5 Q