From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9797 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Bug in timezone handling (new zonename format like '<+04>-4' ) Date: Thu, 31 Mar 2016 12:06:47 -0400 Message-ID: <20160331160647.GV21636@brightrain.aerifal.cx> References: <7d2a2332-05ee-6f5e-7ed9-26bf7b8e1aae@iki.fi> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1459440433 22121 80.91.229.3 (31 Mar 2016 16:07:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Mar 2016 16:07:13 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9810-gllmg-musl=m.gmane.org@lists.openwall.com Thu Mar 31 18:07:06 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1alf7f-0008L6-R1 for gllmg-musl@m.gmane.org; Thu, 31 Mar 2016 18:07:03 +0200 Original-Received: (qmail 9579 invoked by uid 550); 31 Mar 2016 16:07:01 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 9545 invoked from network); 31 Mar 2016 16:07:00 -0000 Content-Disposition: inline In-Reply-To: <7d2a2332-05ee-6f5e-7ed9-26bf7b8e1aae@iki.fi> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:9797 Archived-At: On Thu, Mar 31, 2016 at 06:50:14PM +0300, Hannu Nyman wrote: > The IANA timezone zoneinfo maintainers have decided to introduce new > timezones in a simplified format with 2016b zoneinfo. > No more invented name strings, but just the time offset inside <...> > This seems to break musl. > > http://mm.icann.org/pipermail/tz-announce/2016-March/000036.html > New zones Europe/Astrakhan and Europe/Ulyanovsk ... Asia/Barnaul ... > As a trial of a new system that needs less information to be > made up, the new zones use numeric time zone abbreviations like > "+04" instead of invented abbreviations like "ASTT". > > I have tested with Openwrt trunk using musl (with Linux kernel 4.1) > and older uClibc-based Openwrt CC15.05.1. > The uClibc-based system uses the new zones ok, but the musl-based > build behaves badly, as it defaults to GMT and shows the zonename as > '+04>-4'. (This is when full zoneinfo files are not installed and > just the TZ variable is used.) > > Examples at https://github.com/openwrt/luci/issues/675 > > (note: Openwrt patches musl to store TZ in /etc/TZ instead of an env > variable, but that should have no impact in the displayed timezone.) > > Example with musl: > > old zone is ok: > Europe/Helsinki > root@OpenWrt:~# cat /etc/TZ > EET-2EEST,M3.5.0/3,M10.5.0/4 > root@OpenWrt:~# uptime > 11:00:52 up 18:17, load average: 0.43, 0.13, 0.11 > root@OpenWrt:~# date > Wed Mar 30 11:00:55 EEST 2016 > > "new zone" is handle wrongly: > Europe/Astrakhan > root@OpenWrt:~# cat /etc/TZ > <+04>-4 > root@OpenWrt:~# uptime > 08:02:52 up 18:19, load average: 0.17, 0.18, 0.13 > root@OpenWrt:~# date > Wed Mar 30 08:02:59 +04>-4 2016 > (That should be Helsinki+1 (= +2 -DST) = 12:02:59) I thought this was some nonstandard extension conflicting with standard handling of the TZ variable, but in fact it's documented in current POSIX as a quoted form: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03 Does the specification there agree with your expectations of how it should behave? Do you have any other references I could look at on how this is supposed to be used? Rich