public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/114260] std::formatter<std::chrono::utc_time<std::chrono::days>> formats as the previous day
Date: Thu, 07 Mar 2024 23:08:20 +0000 [thread overview]
Message-ID: <bug-114260-4-BFsUg7jmbX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114260-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114260
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
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<days> is not a year_month_day,
it's an exact time point, and it happens to not line up with 00:00:00 for the
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 86400s,
> but rather 27s greater than a multiple of 86400s. And all
> round<days>(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!
prev parent reply other threads:[~2024-03-07 23:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 23:51 [Bug libstdc++/114260] New: " redi at gcc dot gnu.org
2024-03-07 8:18 ` [Bug libstdc++/114260] " redi at gcc dot gnu.org
2024-03-07 22:44 ` howard.hinnant at gmail dot com
2024-03-07 23:08 ` redi at gcc dot gnu.org [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-114260-4-BFsUg7jmbX@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).