Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122439 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id B544B1ACEBF for ; Tue, 20 Feb 2024 08:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1708419502; bh=uX1aDj9XnwtBLMKG5zZbbeKo/PxdBfRNf5S2AbjFztI=; h=Date:From:To:Subject:In-Reply-To:References:From; b=kgaruVHAcyM0s4PPS5SLLTsF2MtsnmjEDn8aKtrzByZlNcEomTPZFqKOA3Eat7mhw nG0M14M9XfmWE9RkESTR9LSR/BLMZ1c9JGXv+dWkWjO0kRnzknAWqRjqkRf/7ztPDv NN1NL1a44zkxaOXzpHzzjawtnZCtOtAzYW1vDVbgPk/EBDbLOHEIphgBRQtGJe3V8R H+WqtbZ1WNJj/gNrKQLS7QdquUn2kGjropwZAnDwtddw+tZtCzVLQjTxjzNFkUYnyx 4YwqZwixXsaYaRDOCWcoaeaPHvmyTNyuY+yl0Rk00efNmnKlcT78cpYCYNnf6MoSa/ TDp+2feHEyEcQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BB3691801E3 for ; Tue, 20 Feb 2024 08:58:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_20,DMARC_MISSING, SPF_HELO_PASS,SPF_NEUTRAL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from xdebug.org (xdebug.org [82.113.146.227]) by php-smtp4.php.net (Postfix) with ESMTP for ; Tue, 20 Feb 2024 00:58:21 -0800 (PST) Received: from [127.0.0.1] (unknown [85.255.235.30]) by xdebug.org (Postfix) with ESMTPSA id B434210C51E; Tue, 20 Feb 2024 08:58:15 +0000 (GMT) Date: Tue, 20 Feb 2024 08:58:14 +0000 To: internals@lists.php.net, Marc Bennewitz Subject: Re: [PHP-DEV] Requesting RFC karma User-Agent: K-9 Mail for Android In-Reply-To: <176d0694-8b9b-4aa2-abea-9bfe8225b713@mabe.berlin> References: <176d0694-8b9b-4aa2-abea-9bfe8225b713@mabe.berlin> Message-ID: Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: derick@php.net (Derick Rethans) On 20 February 2024 08:41:19 GMT, Marc Bennewitz wrote= : >Hi Hans, > >On 16=2E02=2E24 13:05, Hans Henrik Bergan wrote: >> My name is "Hans Henrik Bergan", usually go by the nickname >> "divinity76", I've contributed to OSS (including PHP) for years, and >> am currently involved in 3 things that might require an RFC, and >> requesting RFC karma for wiki account "divinity76"=2E >>=20 >> 3/3: int|float for DateTime::setTimestamp, setTimestamp(0=2E123456) =3D= > >> 1970-01-01 00:00:00=2E123456 : https://github=2Ecom/php/php-src/pull/13= 383 > >Actually I also want to work on this if I find time =2E=2E=2E but as this= is a BC break I think it makes sense to revisit DateTime (and friends) to = bundle BC breaks to a single PHP version - probably PHP 9 and more sure the= re is a way for users to make it work in PHP (7+)8+9=2E > >Personal and incomplete list I think needs improvements: > >* allow float for `setTimestamp` >* option to return timestamp as float to simplify passing it to JS >* Missing getter/setter for most of the date/time parts like `get/setSeco= nd`, `get/setHour` etc=2E >=C2=A0 * For now I only added `get/setMicroseconds` together with `create= FromTimestamp` because `DateTime::createFromTimestamp(123456789)->setMicros= econds(123987)` >=C2=A0 * After thinking about naming - I think this should be renamed to = singular =F0=9F=98=AC >* Add missing methods to DateTimeInterface >* Allow userland implements DateTimeInterface >=C2=A0 * Define how `createFromInterface` behaves on userland implementat= ions >* fixing ISO 8601 format >* fixing some return type definitions from self to static >* strict mode >=C2=A0 * `DateTime::createFromFormat('Y-m-d', '2023-02-29')` >=C2=A0 * `DateTime::createFromFormat('Y-m-d H:i', '2024-03-31 02:30', new= DateTimeZone('Europe/Berlin'))` >* Missing current microseconds on `createFromFormat` but other non define= d parts needs to be explicitly reset using `|!` >* leap seconds support on UTC TZ >=C2=A0 * As of leap seconds =2E=2E=2E wouldn't it be better to default to= +00:00 instead of UTC ? >* Support nanoseconds > > >I'm for sure not able to work on all these points and that's why I only s= tarted very small close to no BC improvements without RFC=2E > > >Marc > IMO, doing tweaks to this base functionality isn't the way forwards=2E I'v= e been having on and off conversations with Florian over the last couple of= months to see if we can design a better higher level API instead of patchi= ng the nits=2E cheers Derick