From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2236A3870C08; Tue, 9 Apr 2024 23:29:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2236A3870C08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712705359; bh=JadtpVhawaszX7z40BT/kYZFIW1NLY9S++QrBFYRWRA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VhDWikgzlPTZa65kGxAM+AA7g967TxkZhg1eFD5Wu7ZkrcIlxmvVqu/IPjualJkqs Pq0ArWL5uTxmRrUebrk+AgA4SG3n3KQMkImf+aJJkn2KOVH8l0WH6GVRLtBxstvcds PXvFi9LD0BmK+M+2jG0UxDOMB+ZN59+oHpAg+eHo= From: "harald at gigawatt dot nl" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/114645] std::chrono::current_zone ignores $TZ on Linux Date: Tue, 09 Apr 2024 23:29: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: harald at gigawatt dot nl 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: cc 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 Harald van Dijk changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |harald at gigawatt dot nl --- Comment #14 from Harald van Dijk --- (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, This does not appear to be accurate. libc++ appears to always uses $TZ on POSIX-like platforms if it is set: https://github.com/llvm/llvm-project/blob/788be0d9fc6aeca548c90bac5ebe6990d= d3c66ec/libcxx/src/tzdb.cpp#L708 MSVC STL calls into __icu_ucal_getDefaultTimeZone. ICU's ucal_getDefaultTimeZone uses the platform-specific way of getting the defau= lt time zone, which on POSIX-like platforms does check getenv("TZ"), although = of course MSVC's STL would not likely be used on POSIX-like platforms.=