Bug #81097 [NEW]: DateTimeZone silently falls back to UTC when providing an offset with seconds

From: Date: Tue, 01 Jun 2021 21:30:11 +0000
Subject: Bug #81097 [NEW]: DateTimeZone silently falls back to UTC when providing an offset with seconds
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234153@lists.php.net to get a copy of this message
From:             benjamin dot morel at gmail dot com
Operating system: N/A
PHP version:      8.0.6
Package:          Date/time related
Bug Type:         Bug
Bug description:DateTimeZone silently falls back to UTC when providing an offset with seconds

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

-- 
Edit bug report at https://bugs.php.net/bug.php?id=81097&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=81097&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=81097&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=81097&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=81097&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=81097&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=81097&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=81097&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=81097&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=81097&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=81097&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81097&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=81097&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=81097&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=81097&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=81097&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=81097&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=81097&r=mysqlcfg


Thread (2 messages)

« previous php.bugs (#234153) next »