From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 866EB2180C for ; Mon, 13 May 2024 23:20:23 +0200 (CEST) Received: (qmail 9224 invoked by uid 550); 13 May 2024 21:20:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 8165 invoked from network); 13 May 2024 21:20:17 -0000 Date: Mon, 13 May 2024 21:18:21 +0000 (UTC) From: Thorsten Glaser X-X-Sender: tg@herc.mirbsd.org To: musl@lists.openwall.com In-Reply-To: <20240513121802.GX10433@brightrain.aerifal.cx> Message-ID: References: <20240511212853.GS10433@brightrain.aerifal.cx> <20240513121802.GX10433@brightrain.aerifal.cx> Content-Language: de-Zsym-DE-1901-u-em-text-rg-denw-tz-utc, en-Zsym-GB-u-cu-eur-em-text-fw-mon-hc-h23-ms-metric-mu-celsius-rg-denw-tz-utc-va-posix MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Subject: Re: [musl] strptime(s, "%Y-%j", &tm) does not update month and day Rich Felker dixit: >if you assume POSIX-compatible time_t, just adding 86400*tm_yday to >the time_t. AIUI, POSIX (Issue 8) suggests to add 86400*tm_yday to tm_sec and using mktime to normalise it. If you don=E2=80=99t start at 00:00:00 UTC, it should even work for systems that honour leap seconds (say start at 1st January, 12:00:00 UTC; the result may than be not at 12:00:00, but the day should be right). bye, //mirabilos --=20 =E2=80=9CIt is inappropriate to require that a time represented as seconds since the Epoch precisely represent the number of seconds between the referenced time and the Epoch.=E2=80=9D =09-- IEEE Std 1003.1b-1993 (POSIX) Section B.2.2.2