From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 151FA3858D35; Fri, 8 Mar 2024 06:51:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 151FA3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709880665; bh=TMnzmF5955wOklk6GOmedjwu4ZcXeOwJ+8v8Fhg1x5E=; h=From:To:Subject:Date:From; b=J5LMr/oXtVKGUeV2BuJ7YI5SKbYm3I3/8tv5lRaYlgbdeVbibYVgfLP2lFjFcTwIO usGkb5+jU340/qGSPeVOP4RjlMLJOAGnAEBcnws4gZJaHgcr49FZvUho2CWY3N0aUv 5KfPpOWchRyGop7FPXNjYMtJGkRfE6FrYMeR04AU= From: "gnaggnoyil at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/114279] New: utc_clock does not support leap seconds Date: Fri, 08 Mar 2024 06:51:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: gnaggnoyil at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D114279 Bug ID: 114279 Summary: utc_clock does not support leap seconds Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: gnaggnoyil at gmail dot com Target Milestone: --- When using current GCC trunk, the program #include #include #include int main(){ std::stringstream stream; stream << "20161231-23:59:60.035"; std::chrono::utc_time utc_tp; (void)std::chrono::from_stream(stream, "%4Y%2m%2d-%2H:%2M:%S", utc_= tp); std::cout << utc_tp << std::endl; return 0; } gives the following output: 2017-01-01 00:00:00.035 which does not seems to give leap seconds into consideration. The current standard working draft [time.clock.utc.overview]#1 states In contrast to sys_time, which does not take leap seconds into account, utc_clock and its associated time_point, utc_time, count time, including le= ap seconds, since 1970-01-01 00:00:00 UTC. So I think the current libstdc++ implementation here is not conforming the standard.=