php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81097 DateTimeZone silently falls back to UTC when providing an offset with seconds
Submitted: 2021-06-01 21:30 UTC Modified: 2021-08-08 12:43 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: benjamin dot morel at gmail dot com Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 8.0.6 OS: N/A
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: benjamin dot morel at gmail dot com
New email:
PHP Version: OS:

 

 [2021-06-01 21:30 UTC] benjamin dot morel at gmail dot com
Description:
------------
As discussed in https://externals.io/message/114669

DateTimeZone silently falls back to UTC when providing an offset with seconds:

https://3v4l.org/9ZrK6

It should either work as expected with such an input, or if this is unsupported (which could make sense), it should throw an exception.

Test script:
---------------
echo (new DatetimeZone('+01:45:30'))->getName();

Expected result:
----------------
+01:45:30

Actual result:
--------------
+00:00

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-01 21:58 UTC] derick@php.net
-Assigned To: +Assigned To: derick
 [2021-08-08 12:43 UTC] derick@php.net
-Status: Assigned +Status: Closed
 [2021-08-08 12:43 UTC] derick@php.net
The fix for this bug has been committed.
If you are still experiencing this bug, try to check out latest source from https://github.com/php/php-src and re-test.
Thank you for the report, and for helping us make PHP better.

For 8.1.0beta3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 07:01:29 2024 UTC