Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116035 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 88140 invoked from network); 13 Sep 2021 10:54:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Sep 2021 10:54:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4F897180510 for ; Mon, 13 Sep 2021 04:33:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 13 Sep 2021 04:33:46 -0700 (PDT) Received: by mail-pg1-f173.google.com with SMTP id 17so9183020pgp.4 for ; Mon, 13 Sep 2021 04:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=3GJ2L+ZN3V6b8gHzRV5NTsKqeTaS+HQEDhGBt9kRmaA=; b=AQ8F/kIIpMFR55YWVcfZWCN1iptF7NIElYlUPm4xyGB5OSN3pinTEve0hLMeg1+rYm c4VCVtX6neeKS54SIWDTzFxOr0noIacsFICYOtdm29SKJnsifTDAHMk6lCdYX+6aJA8J YEgXxY9kJlUozGj8lqSofQ5R3udS3r8YITbgWyaYAijvyGzsV7ikuBDKPEUkgVIuNCqO afMk6URklcdw5HFH176v++QQ7Ek2+jdlvjw/jgjML2oyxHSE6gW6argMZ2MKXsOzDIVk 1zyu1jnfkiGS6etBcMXTxFUOx++oNTQHrr6k0kf9UmMmVSqz46RR5aDc5beNJbGSOs1d ABuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=3GJ2L+ZN3V6b8gHzRV5NTsKqeTaS+HQEDhGBt9kRmaA=; b=J+Ie2s5BoUDzw229MDdxmNWJPZXdlS52Lk8GmSqEJ2zwxJIf9Ci0llv/Y1Zz0tj8BH NqJih0q/FxW/9nFxGIN5ARzmw0FN2xdOb3RWCwO1sFfHhyGF8PEfrjx7Ukn566uR82I2 CF4MAN3OQ8UHq9fUjPiC3gv2TPAKdAvdJZ7ruQrWss2o4NGqdhloMdY5QBH4a8BOzMEB 4nlcenWBNoE3iCPj1KoMehAhC4Its6OeHCeQnz28KmRZzx4cdw68O71b5m+gDxRDieRu aRglL3DZ+3P2/mWO1dnPZQFkqIUTZAhGq7VZxz8GiXgMmDMc2KDItDdT9kozx67+Brey HJ+A== X-Gm-Message-State: AOAM530eOMxau3FvwRNelu0hePUlTDvpvItKbP/xPty4SlvPaoVLF/1Q r9xo0g4AT34kwZDMvqPm6aSZfqriGHyATFVwWYr1+uZizRPAe5vW X-Google-Smtp-Source: ABdhPJzpJvnbbdZQBTRWFYAQvvhORX1VcPotjBKAFwznWngc2lZ/mI2wkgAWBc7G8Ycl4jO/oA3oltCO0KOZcbIQsYY= X-Received: by 2002:a63:34c6:: with SMTP id b189mr10795173pga.122.1631532825303; Mon, 13 Sep 2021 04:33:45 -0700 (PDT) MIME-Version: 1.0 References: <9ECA71F4-F57A-4184-9713-0EF8B7131F97@php.net> In-Reply-To: Date: Mon, 13 Sep 2021 13:33:09 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000007ddce305cbded62b" Subject: Re: [PHP-DEV] DateTimeZone silently falls back to UTC when providing seconds From: divinity76@gmail.com (Hans Henrik Bergan) --0000000000007ddce305cbded62b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable >What use-case does that serve? if some country want to change their timezone for whatever reason, to some timezone that didn't exist previously, could happen at any time really On Mon, 13 Sept 2021 at 13:32, Hans Henrik Bergan wrote: > > What use-case does that serve? > > if some country want to change their timezone for whatever reason, to som= e > timezone that didn't exist previously, could happen at any time really > > On Sun, 12 Sept 2021 at 13:06, Andreas Heigl wrote: > >> Hey Benjamin, Hey All >> >> On 11.09.21 23:58, Benjamin Morel wrote: >> >> >> >>> Before doing so, shouldn't we discuss whether it makes sense to acce= pt >> >>> a >> >>> time-zone offset with seconds, when the granularity seems to be 15 >> >>> mins? >> >>> >> >>> https://en.wikipedia.org/wiki/List_of_UTC_time_offsets >> >>> >> >>> =E2=80=94 Benjamin >> >> >> >> No need. Early timezone offsets in the timezone database are in LMT >> (local >> >> mean time), which have second granularity. >> >> >> >> cheers, >> >> Derick >> > >> > >> > Hi, sorry for resurrecting an old thread, but now that this bug >> > has been fixed in PHP 8.0.10= , >> I can >> > see that seconds have been forbidden from DateTimeZone altogether: >> > >> > https://3v4l.org/QpSln >> > >> > Before forbidding seconds in brick/date-time's *TimeZoneOffset* as wel= l >> > (and going against JSR-310, which this library was derived from), can = I >> > please know why this decision was made, when as I understand it, this >> goes >> > against your statement above? >> >> For me the more interesting question is: "Why would one allow to create >> any arbitrary Timezone-object using any offset at all?" >> >> Currently it is even possible to declare a Timezone Object with an >> Offset that has never been used anywhere on the globe. So for example >> `new DateTimezone(`+11:32`) is completely valid from a coding point of >> view but not from a timezone point of view. What use-case does that serv= e? >> >> If one has to create a timezone-object for an existing timezone one can >> create that either via `new DateTimezone('Continent/Whatever')` or via >> `new DateTimezone('Etc/GMT+XX')` or via `new DateTimezone('PST')`. >> >> This does currently not support creating offset-based timezone-objects >> for areas such as Nepal or India that use an offset that currently can't >> be declared via the `Etc`-Identifiers. >> >> So a different approach would be to only support type 1 offsets that are >> known to the TZDB. Everything else (including arbitrary seconds) should >> result in an exception. >> >> So I can understand to not allow arbitrary seconds at all. But IMO we >> should then also not allow arbitrary minutes also. >> >> But that's just my 0.02 =E2=82=AC >> >> Cheers >> >> Andreas >> -- >> ,,, >> (o o) >> +---------------------------------------------------------ooO-(_)-Ooo-+ >> | Andreas Heigl | >> | mailto:andreas@heigl.org N 50=C2=B022'59.5" E 08=C2= =B023'58" | >> | https://andreas.heigl.org | >> +---------------------------------------------------------------------+ >> | https://hei.gl/appointmentwithandreas | >> +---------------------------------------------------------------------+ >> > --0000000000007ddce305cbded62b--