Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121494 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14313 invoked from network); 28 Oct 2023 15:33:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Oct 2023 15:33:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 645E91804BC for ; Sat, 28 Oct 2023 08:33:08 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 28 Oct 2023 08:33:08 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-32d81864e3fso1925441f8f.2 for ; Sat, 28 Oct 2023 08:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698507186; x=1699111986; darn=lists.php.net; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=3Alwp7EQgJW5ihq9cvXzPSSLZ4PICHFd30CG985m1AY=; b=fhVxUAUGUzwuuamtoFUqU9DFXxQBMsXvU7HmJAP3nt+oQVVJ2ir+YCHPMl9GD8c6gq AxcmcI8hRtSQ8Tjxevo8g7rr0fOQEnaJ+qMZlvkDR0l8QfQ1YyHKWy1vk/xrBGdxURl4 B49/XPa+cYYdFqQqP1n5RnZC8rL7f+oJ+JspF3kAeR1zdA8Cn3dgy+dEXRME7mNGrFeC W56ss7mq+WUrVGVWqDnFbcmAZrfbuhwDfb5xbrZA6AdBPiULhkBu2BWQLxsi1M0yn3r1 l1Ue7VVMmZHwpgwKKJMgToP8yAH1Uf56+QpRQCCxGixAGohY0o2UWffiMki7elFIaAG3 AbHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698507186; x=1699111986; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3Alwp7EQgJW5ihq9cvXzPSSLZ4PICHFd30CG985m1AY=; b=d4oAklO1s0jcrpHBosqzcsRdZuIImPa2aQHSt3uIpiC7hBkPFw+u/3b2qEpChkVB2q qNZKZMaCaphzQj6oQVVtcNL9P9ffGsJpTnuUwdcalg+qjJEg65FVlL8rJ5B3cX2eoruy C75zBfA8ye6Ra31RKxsWTuY1iTFxtOSSKcbdDypkYaZuxSjgDkKUra4CgUwQl5kEXLF8 idGcPEufZ9M1oK/RaiCMynoTXUB6vTKuvojXnL6sHtoRb5H9I6YeAjp4zTBNlsuPQG68 t4J8GmiqOEKLmzReOLYXmoSKg7yyo//J3EZ477kD41Ev4Et2Pq07oQoIe41QKztMqWjE diMA== X-Gm-Message-State: AOJu0Yw5I0EiMqc3tF1x1vQrUHlRZcH8MFEzJubz5koCRhqvbk/HfMNX SiRk/54x0uugcczihD0YoMPPGObWQzs= X-Google-Smtp-Source: AGHT+IFfhQEd+cEVT2wdw7oQ3c+t+TFTyK1qDl+HW4qmQ8GFTYT2682dtLt02DmxxkFRmVYz5wxmDw== X-Received: by 2002:adf:e7c2:0:b0:32d:ae31:458f with SMTP id e2-20020adfe7c2000000b0032dae31458fmr4028722wrn.30.1698507186489; Sat, 28 Oct 2023 08:33:06 -0700 (PDT) Received: from [127.0.0.1] (cpc83311-brig21-2-0-cust191.3-3.cable.virginm.net. [86.20.40.192]) by smtp.gmail.com with ESMTPSA id w16-20020adfee50000000b0032db1d741a6sm4009491wro.99.2023.10.28.08.33.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Oct 2023 08:33:06 -0700 (PDT) Date: Sat, 28 Oct 2023 16:33:04 +0100 To: internals@lists.php.net User-Agent: K-9 Mail for Android In-Reply-To: References: <675b54f5-3fe5-4ecd-89dc-4c9dfc0cd77e@mabe.berlin> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] New DateTime[Immutable]::createFromTimestamp From: rowan.collins@gmail.com (Rowan Tommins) On 28 October 2023 15:40:29 BST, Saki Takamachi wrote: >Hi Marc, > >Personally, I don't think these are necessarily necessary since there is = a "from format"=2E As noted on the PR, both the default constructor and createFromFormat requ= ire the input to be converted to a string, which tends to make code messy= =2E It's then converted back to an integer internally, which isn't very eff= icient=2E I would be in favour of adding this method=2E >I have one concern=2E float is imprecise, so I don't think it's suitable = for this kind of use=2E For timestamps, 16 digits are used, which exceeds t= he guaranteed precision of 15 digits on non-IBM platforms=2E I'm not sure where you got those numbers; on a 64-bit architecture (surely= the vast majority of PHP installs), a float can precisely represent any wh= ole number from -2**53 up to 2**53 - 1=2E As a Unix timestamp, that's a one= -second accuracy for any time 285 million years into the past or future=2E = https://www=2Ewolframalpha=2Ecom/input?i=3D2**53+as+unix+timestamp Possibly you're thinking of a representation that counts integers as milli= seconds or microseconds, instead of seconds? Regards, --=20 Rowan Tommins [IMSoP]