DateTimeZone silently falls back to UTC when providing seconds

  114669
May 30, 2021 21:45 benjamin.morel@gmail.com (Benjamin Morel)
Hi internals,

An issue <https://github.com/brick/date-time/issues/35> was brought up on
my date-time library, that boils down to the fact that DateTimeZone
silently falls back to UTC when providing an offset with seconds:

(new DatetimeZone('+01:45:30'))->getName(); // 00:00

https://3v4l.org/9ZrK6

If this is unsupported (this would make sense), should it throw an
exception instead?

Thank you for your time.

⁠— Benjamin
  114670
May 30, 2021 22:10 derick@php.net (Derick Rethans)
On 30 May 2021 22:45:12 BST, Benjamin Morel morel@gmail.com> wrote:
>Hi internals, > >An issue <https://github.com/brick/date-time/issues/35> was brought up >on >my date-time library, that boils down to the fact that DateTimeZone >silently falls back to UTC when providing an offset with seconds: > >(new DatetimeZone('+01:45:30'))->getName(); // 00:00 > >https://3v4l.org/9ZrK6 > >If this is unsupported (this would make sense), should it throw an >exception instead? > >Thank you for your time. > >⁠— Benjamin
I can't think of why this couldn't work. Duke a bug report please at bugs.php.net?
  114671
May 30, 2021 22:18 benjamin.morel@gmail.com (Benjamin Morel)
> > I can't think of why this couldn't work. Duke a bug report please at > bugs.php.net?
Before doing so, shouldn't we discuss whether it makes sense to accept a time-zone offset with seconds, when the granularity seems to be 15 mins? https://en.wikipedia.org/wiki/List_of_UTC_time_offsets — Benjamin
  114672
May 30, 2021 22:32 derick@php.net (Derick Rethans)
On 30 May 2021 23:18:31 BST, Benjamin Morel morel@gmail.com> wrote:
>> >> I can't think of why this couldn't work. Duke a bug report please at >> bugs.php.net? > > >Before doing so, shouldn't we discuss whether it makes sense to accept >a >time-zone offset with seconds, when the granularity seems to be 15 >mins? > >https://en.wikipedia.org/wiki/List_of_UTC_time_offsets > >— Benjamin
No need. Early timezone offsets in the timezone database are in LMT (local mean time), which have second granularity. cheers, Derick