You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dates Created from Strings with Timezone Offsets Aren't Properly Formatted When Using 'p' #10447
<?phpdate_default_timezone_set('Europe/Berlin');
$date = new \DateTime('2023-01-25T00:00:00');
echo$date->format('p');
?>
For missing offset is default offset:
Expected result: +01:00
For explicit offset +00:00
Expected result: +00:00
Or !localtime a6e3ce4#diff-975ac482adc74b487c6ac9d8dde32153e4b8a803ef8ec41e8d6594f0a042db69R715
Expected result with p and timezone UTC
$date2 = new DateTime('now', new DateTimeZone('UTC'));
echo $date2->format('p'); // Z
I assumed it had been verified because the "needs triage" was removed. Though I did briefly confirm that "p" wasn't outputting just Z which it's documented to do.
Activity
hormus commentedon Jan 26, 2023
Currently support p is with timezone type 3 or type 2 "UTC" or explicit "Z" https://php.watch/versions/8.0/date-utc-p-format :)
For missing offset is default offset:
Expected result: +01:00
For explicit offset +00:00
Expected result: +00:00
Or !localtime
a6e3ce4#diff-975ac482adc74b487c6ac9d8dde32153e4b8a803ef8ec41e8d6594f0a042db69R715
Expected result with p and timezone UTC
$date2 = new DateTime('now', new DateTimeZone('UTC'));
echo $date2->format('p'); // Z
derickr commentedon Jan 26, 2023
@damianwadley Why did you change this to "Verified" — I see no triage report as to why this issue occurs, and whether this is an issue at all.
damianwadley commentedon Jan 26, 2023
I assumed it had been verified because the "needs triage" was removed. Though I did briefly confirm that "p" wasn't outputting just
Zwhich it's documented to do.Fixed phpGH-10447: 'p' format specifier does not yield 'Z' for 00:00
Merge remote-tracking branch 'derickr/GH-10447-p-format-specifier' in…