Skip to content

Dates Created from Strings with Timezone Offsets Aren't Properly Formatted When Using 'p' #10447

Closed
@dustinwilson

Description

@dustinwilson

Description

The following code:

<?php
$date = new \DateTimeImmutable('2023-01-25T00:00:00+00:00');
echo $date->format('Y-m-d\TH:i:sp');

Resulted in this output:

2023-01-25T00:00:00+00:00

But I expected this output instead:

2023-01-25T00:00:00Z

PHP Version

8.2.1

Operating System

MacOS Monterey (12.6.3)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions