From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 42DE5385782F; Thu, 7 Mar 2024 23:08:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42DE5385782F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709852901; bh=rfCOPSpV9P3Gr80Q/6NTaO6l3VwrB5ozeH1o3MM1eFk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nazWBGfyilK1vAt53KB9hYgHGR50+/agS4CuZueCqJE2g4NZiaqfyGh0fuJ2yxKjZ oO6Oaa1+ST5kIt7T672AZVKFyo4Hp+/YxFLBZgTDPpxc2dU0/l/aY2b1uYvLtZum8l e+LdjNBonKU1aZ06uaeFQgZCAlkHvRGwcmOtruS8= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/114260] std::formatter> formats as the previous day Date: Thu, 07 Mar 2024 23:08:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114260 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #3 from Jonathan Wakely --- Yup, I understand why that's the output. I just thought it seemed off that something rounded to days didn't land at 00:00:00 and convinced myself that= it should be "corrected". But of course utc_time is not a year_month_day, it's an exact time point, and it happens to not line up with 00:00:00 for t= he reason you gave: (In reply to Howard Hinnant from comment #2) > Consequently, 2024-03-05 00:00:00 in utc_time is *not* a multiple of 8640= 0s, > but rather 27s greater than a multiple of 86400s. And all > round(udays) does is round the .time_since_epoch() to the nearest > multiple of 86400s. Which in utc_time is 27s earlier, or 2024-03-04 > 23:59:33. So not a bug then. Thanks for talking me out of introducing a bug here!=