Skip to content

DateTimeZone::getName() does not include seconds in offset #11281

Closed
ThePHPF/thephp.foundation
#90
@BenMorel

Description

@BenMorel

Description

The following code:

<?php
$tz = new DateTimeZone('+03:00:01');
echo $tz->getName();

Resulted in this output:

+03:00

But I expected this output instead:

+03:00:01

Context: since PHP 8.1.7 (#8589), time-zone offsets with seconds are properly supported:

https://3v4l.org/m5VkU

But it looks like getName() has not been updated to support seconds.

PHP Version

8.2.6

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions