From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34315: [PATCH] icalendar.el: DURATION fix + more robust timezone handling Date: Mon, 18 Feb 2019 17:59:09 +0200 Message-ID: <83y36djdf6.fsf@gnu.org> References: <23640.9851.562972.730234@AGAME7.local> <875ztog7hx.fsf@panama> <87wom1otsw.fsf@panama> <23658.31901.831381.517915@AGAME7.local> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="50978"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34315@debbugs.gnu.org To: Thomas Plass Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 18 17:18:42 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvlcu-000D7p-TG for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 17:18:41 +0100 Original-Received: from localhost ([127.0.0.1]:33009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvlct-0005rO-RA for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 11:18:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:32776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvlWo-0001Nr-UY for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 11:12:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvlKs-0001VQ-Ve for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 11:00:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53822) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvlKs-0001VG-RG for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 11:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gvlKs-000639-JV for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 11:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Feb 2019 16:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34315 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 34315-submit@debbugs.gnu.org id=B34315.155050555323171 (code B ref 34315); Mon, 18 Feb 2019 16:00:02 +0000 Original-Received: (at 34315) by debbugs.gnu.org; 18 Feb 2019 15:59:13 +0000 Original-Received: from localhost ([127.0.0.1]:53103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvlK4-00061f-Nb for submit@debbugs.gnu.org; Mon, 18 Feb 2019 10:59:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvlK3-00061T-DE for 34315@debbugs.gnu.org; Mon, 18 Feb 2019 10:59:11 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvlJw-0001Bk-JC; Mon, 18 Feb 2019 10:59:04 -0500 Original-Received: from [176.228.60.248] (port=1854 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gvlJw-0003PZ-4b; Mon, 18 Feb 2019 10:59:04 -0500 In-reply-to: <23658.31901.831381.517915@AGAME7.local> (thunk2@arcor.de) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155495 Archived-At: > Date: Mon, 18 Feb 2019 10:36:29 +0100 > From: thunk2@arcor.de (Thomas Plass) > Cc: 34315@debbugs.gnu.org > > I don't know what makes Sat, Nov 3 2018 (and the weekdays preceding > it) so peculiar, but my hunch is its proximity to the DST transition > that occured on the Sunday six days earlier, the "fifth week" of Oct. > > The decode/encode combo in the forms below is essentially the > guts of icalendar--decode-isodatetime(), old and patched. The > zone rule for Europe/Berlin is the current standard one, also > computed by icalendar--convert-tz-offset(). > > The point of these examples is to see how time zone rules > missing/supplied/in environment affect date-time conversions. > > Here's code for a same-zone scenario, note the two TZ setenv()s: > > (let ((Europe/Berlin "STD-01:00DST-02:00,M3.5.0/02:00:00,M10.5.0/03:00:00")) You cannot expect MS-Windows to support Posix DST rules such as above in the C runtime functions like mktime, localtime, etc. Windows support for DST rules in C runtime is very rudimentary, and is limited to the likes of EST-5DST, without any specification of when the DST transitions happen (the transition dates are hard-coded in the Windows C runtime). I think this factoid goes a long way towards explaining why you get wrong results for the timezone offset around the DST transition date. To make myself clear: modern Windows systems do have database of DST transition rules, and they do apply these rules both for setting the system clock and in APIs such as GetTimeZoneInformation. But the rules are not in Posix format (although the information is of course equivalent), and these capabilities are not propagated to C runtime functions which Emacs uses.