From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E2C813858C56; Tue, 9 Apr 2024 23:43:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2C813858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712706197; bh=WY8YgE/jvLibJbyePZalmHuTmu+maGXgEipDyEwiofw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RtVZkcHPOfhZ3ENbhUex0QfZYSRtH27W1zyMdIqWQkNcUPbNEKN0CMa50ObHGHMD1 giUZSFHCgBVxgwT+FYu+StpMBkRfz+EVUHznKForV1iGTu29Uh0bbEYTTw0chXuIJ8 z65yAWj1ntqW2/Vcqb7Gxu0dQVhn55kjNsKpAIHw= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/114645] std::chrono::current_zone ignores $TZ on Linux Date: Tue, 09 Apr 2024 23:43:17 +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: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX 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: 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=3D114645 --- Comment #16 from Jonathan Wakely --- (In reply to Harald van Dijk from comment #14) > (In reply to Jonathan Wakely from comment #8) > > None of libstdc++, LLVM libc++, MSVC STL or the > > date/tz.h reference implementation uses $TZ for chrono::current_zone, >=20 > This does not appear to be accurate. >=20 > libc++ appears to always uses $TZ on POSIX-like platforms if it is set: > https://github.com/llvm/llvm-project/blob/ > 788be0d9fc6aeca548c90bac5ebe6990dd3c66ec/libcxx/src/tzdb.cpp#L708 ... incorrectly though? I would expect TZ=3D:Europe/London to work according to POSIX, but it seems= they don't remove the ':' before the lookup. So it only works for a string like "MST7MDT" which means only the following entries in the IANA database can be matched by a value in $TZ: Z CET 1 c CE%sT Z CST6CDT -6 u C%sT Z EET 2 E EE%sT Z EST -5 - EST Z EST5EDT -5 u E%sT Z Factory 0 - -00 Z HST -10 - HST Z MET 1 c ME%sT Z MST -7 - MST Z MST7MDT -7 u M%sT Z PST8PDT -8 u P%sT Z WET 0 E WE%sT That doesn't seem very well thought out or tested.=