Skip to content

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

Closed
ThePHPF/thephp.foundation
#90

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

Activity

  1. ndossche commented on May 19, 2023

    @ndossche
    Member

    Seems like the internal function php_timezone_to_string() is not updated indeed.

  2. added 2 commits that reference this issue on May 23, 2023
    f9117eb
    caab608
  3. added a commit that references this issue on May 23, 2023
    505a30c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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