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-06-01 21:58 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: Assigned Package: Date/time related
PHP Version: 8.0.6 OS: N/A
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-01 21:58 UTC] derick@php.net
-Assigned To: +Assigned To: derick
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Jul 28 18:01:25 2021 UTC