[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
BenMorel opened this issue May 19, 2023 · 1 comment · Fixed by ThePHPF/thephp.foundation#90
Closed

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

BenMorel opened this issue May 19, 2023 · 1 comment · Fixed by ThePHPF/thephp.foundation#90

Comments

@BenMorel
Copy link
Contributor

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

@nielsdos
Copy link
Member

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

nielsdos added a commit to nielsdos/php-src that referenced this issue May 19, 2023
…offset

If the seconds portion is non-zero, include the seconds in the output.
nielsdos added a commit to nielsdos/php-src that referenced this issue May 19, 2023
…offset

If the seconds portion is non-zero, include the seconds in the output.
iluuu1994 added a commit to iluuu1994/php-src that referenced this issue May 22, 2023
iluuu1994 added a commit to iluuu1994/php-src that referenced this issue May 22, 2023
iluuu1994 added a commit to iluuu1994/php-src that referenced this issue May 22, 2023
iluuu1994 added a commit to iluuu1994/php-src that referenced this issue May 22, 2023
nielsdos added a commit that referenced this issue May 23, 2023
* PHP-8.1:
  Fix GH-11281: DateTimeZone::getName() does not include seconds in offset
nielsdos added a commit that referenced this issue May 23, 2023
* PHP-8.2:
  Fix GH-11281: DateTimeZone::getName() does not include seconds in offset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
@BenMorel @nielsdos and others