From unknown Fri Jun 20 18:23:28 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#15408 <15408@debbugs.gnu.org> To: bug#15408 <15408@debbugs.gnu.org> Subject: Status: 23.4; icalendar import: daylight saving time Reply-To: bug#15408 <15408@debbugs.gnu.org> Date: Sat, 21 Jun 2025 01:23:28 +0000 retitle 15408 23.4; icalendar import: daylight saving time reassign 15408 emacs submitter 15408 Christophe Deleuze severity 15408 normal tag 15408 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 18 12:06:17 2013 Received: (at submit) by debbugs.gnu.org; 18 Sep 2013 16:06:17 +0000 Received: from localhost ([127.0.0.1]:46937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VMKGe-00072Y-Qx for submit@debbugs.gnu.org; Wed, 18 Sep 2013 12:06:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56574) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VMHDY-00020X-MZ for submit@debbugs.gnu.org; Wed, 18 Sep 2013 08:50:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMHDK-0008Mz-SM for submit@debbugs.gnu.org; Wed, 18 Sep 2013 08:50:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_TVD_MIME_NO_HEADERS autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:55529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMHDK-0008Mt-CV for submit@debbugs.gnu.org; Wed, 18 Sep 2013 08:50:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMHDD-0007zO-W2 for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2013 08:50:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMHD7-0008L3-T6 for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2013 08:50:31 -0400 Received: from mx1.esisar.grenoble-inp.fr ([195.220.37.33]:60885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMHD7-0008Kr-JN for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2013 08:50:25 -0400 Received: from localhost.localdomain (unknown [172.20.4.94]) by mx1.esisar.grenoble-inp.fr (Postfix) with ESMTP id AA70724403E0 for ; Wed, 18 Sep 2013 14:50:23 +0200 (CEST) Received: by localhost.localdomain (Postfix, from userid 1000) id 2D5B681C034; Wed, 18 Sep 2013 14:54:02 +0200 (CEST) Received: from ES0871.esisar.inpg.fr (localhost [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id 111FD81C033 for ; Wed, 18 Sep 2013 14:54:02 +0200 (CEST) From: Christophe Deleuze To: bug-gnu-emacs@gnu.org Subject: 23.4; icalendar import: daylight saving time X-Mailer: MH-E 8.5; nmh 1.3; GNU Emacs 23.4.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Wed, 18 Sep 2013 14:54:01 +0200 Message-ID: <4750.1379508841@ES0871.esisar.inpg.fr> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 18 Sep 2013 12:06:13 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= [This is a small bug in icalendar.el. A simple fix is provided. Although tested on version 23.4, I checked the file icalendar.el hasn't changed in current developpement version (downloaded for bazaar repository on Sep 4th).] * bug description When importing an ics file into a diary file, date/times are not always correctly converted from UTC to local time zone. Example: let's import the provided mini.ics icalendar file, where dates are in UTC (trailing 'Z'), on a system using the Europe/Paris time zone. This time zone has a time 2 hours ahead of UTC during daylight saving and 1 hour ahead otherwise. The file contains two events, the first one is planned on november 12 2013, from 12:15 to 14:00 UTC, the second one is planned on september 12 2013, from 8:00 to 9:45 UTC. september 12 2013 is in daylight saving time period, while december 11 2013 is not. The generated diary file (provided as mini.diary) shows a 2 hours offset has been added to both events, while it should have added a single hour offset to the second one. It has been generated on september 7 2013, during daylight saving time period. Please note that my emacs uses the european date display style, so that september 12 2013 is written as 12/9/2013 in the diary file. * fix description The function icalendar--decode-isodatetime in calendar/icalendar.el calls (current-time-zone) to add current time zone offset when the ics time is UTC. However, the function is called without argument, meaning the returned offset is the one applying at the time of calling. It should be called with the (UTC) date/time of the converted date/time so that computed offset is the one in force at that precise date/time. The patch file icalendar.patch fixes the problem. File mini.diary-patched is the result of importing mini.ics with the patched icalendar.el file. * changelog Small change in icalendar--decode-isodatetime. --=-=-= Content-Type: text/calendar; charset=utf-8 Content-Disposition: attachment; filename=mini.ics Content-Transfer-Encoding: quoted-printable Content-Description: example ics file BEGIN:VCALENDAR METHOD:REQUEST PRODID:-//ADE/version 5.2 VERSION:2.0 CALSCALE:GREGORIAN BEGIN:VEVENT DTSTAMP:20130902T152652Z DTSTART:20130912T080000Z DTEND:20130912T094500Z SUMMARY:TD NE210 LOCATION:A046 DESCRIPTION:\n2AMNE210_2013_S3_TD_G2\nDELEUZE Christophe\n(Export=C3=A9 le:= 02/ 09/2013 17:26) UID:ADE524553495341522d323031332d323031342d323130352d302d30 CREATED:19700101T000000Z LAST-MODIFIED:20130902T152652Z SEQUENCE:1324562812 END:VEVENT BEGIN:VEVENT DTSTAMP:20130902T152652Z DTSTART:20131211T121500Z DTEND:20131211T140000Z SUMMARY:TD NE210 LOCATION:B044 DESCRIPTION:\n2AMNE210_2013_S3_TD_G2\nDELEUZE Christophe\n(Export=C3=A9 le:= 02/ 09/2013 17:26) UID:ADE524553495341522d323031332d323031342d323130352d302d33 CREATED:19700101T000000Z LAST-MODIFIED:20130902T152652Z SEQUENCE:1324562812 END:VEVENT END:VCALENDAR --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename=mini.diary Content-Transfer-Encoding: quoted-printable Content-Description: diary from importing mini.ics (w/ bad time) 12/9/2013 10:00-11:45 TD NE210 Desc:=20 2AMNE210_2013_S3_TD_G2 DELEUZE Christophe (Export=E9 le:02/09/2013 17:26) Location: A046 11/12/2013 14:15-16:00 TD NE210 Desc:=20 2AMNE210_2013_S3_TD_G2 DELEUZE Christophe (Export=E9 le:02/09/2013 17:26) Location: B044 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename=mini.diary-patched Content-Transfer-Encoding: quoted-printable Content-Description: (correct) diary from importing mini.ics w/ patch applied 12/9/2013 10:00-11:45 TD NE210 Desc:=20 2AMNE210_2013_S3_TD_G2 DELEUZE Christophe (Export=E9 le:02/09/2013 17:26) Location: A046 11/12/2013 13:15-15:00 TD NE210 Desc:=20 2AMNE210_2013_S3_TD_G2 DELEUZE Christophe (Export=E9 le:02/09/2013 17:26) Location: B044 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=icalendar.patch Content-Description: patch *** calendar/icalendar.el.old 2013-09-04 11:17:18.000000000 +0200 --- calendar/icalendar.el 2013-09-04 11:20:29.000000000 +0200 *************** *** 562,570 **** (when (and (> (length isodatetimestring) 15) ;; UTC specifier present (char-equal ?Z (aref isodatetimestring 15))) ;; if not UTC add current-time-zone offset ! (setq second (+ (car (current-time-zone)) second))) ;; shift if necessary (if day-shift (let ((mdy (calendar-gregorian-from-absolute (+ (calendar-absolute-from-gregorian --- 562,573 ---- (when (and (> (length isodatetimestring) 15) ;; UTC specifier present (char-equal ?Z (aref isodatetimestring 15))) ;; if not UTC add current-time-zone offset ! ;; current-time-zone should be called with actual UTC time ! ;; (daylight saving at that time may differ to current one) ! (setq second (+ (car (current-time-zone ! (encode-time second minute hour day month year 0))) second))) ;; shift if necessary (if day-shift (let ((mdy (calendar-gregorian-from-absolute (+ (calendar-absolute-from-gregorian --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 30 12:33:09 2014 Received: (at 15408) by debbugs.gnu.org; 30 Jul 2014 16:33:09 +0000 Received: from localhost ([127.0.0.1]:52019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XCWoO-0006MB-Hr for submit@debbugs.gnu.org; Wed, 30 Jul 2014 12:33:08 -0400 Received: from mo4-p05-ob.smtp.rzone.de ([81.169.146.180]:23983) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XCWoL-0006Lv-VI; Wed, 30 Jul 2014 12:33:06 -0400 X-RZG-AUTH: :OWACVUW4a/MW23Dy3JvWYzB9ib5hHLJRJ2XqtRyYWgVkiE+SMu2CiYFD8uVyB1XN X-RZG-CLASS-ID: mo05 Received: from p55m-ud2 (pD9E25B96.dip0.t-ipconnect.de [217.226.91.150]) by smtp.strato.de (RZmta 35.2 DYNA|AUTH) with ESMTPSA id f02d6aq6UGX3zRa (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate); Wed, 30 Jul 2014 18:33:03 +0200 (CEST) From: Ulf Jasper To: Christophe Deleuze Subject: Re: bug#15408: 23.4; icalendar import: daylight saving time References: <4750.1379508841@ES0871.esisar.inpg.fr> Date: Wed, 30 Jul 2014 18:33:03 +0200 Message-ID: <87a97qkds0.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: 15408 Cc: 15408@debbugs.gnu.org, 15408-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.9 (/) Christophe Deleuze writes: > [This is a small bug in icalendar.el. A simple fix is provided. I applied your patch to the trunk (and added a unit test), rev. 117612. Thank you very much! From unknown Fri Jun 20 18:23:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 28 Aug 2014 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 14 11:42:27 2014 Received: (at control) by debbugs.gnu.org; 14 Oct 2014 15:42:27 +0000 Received: from localhost ([127.0.0.1]:43428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xe4F0-0005xw-OV for submit@debbugs.gnu.org; Tue, 14 Oct 2014 11:42:27 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:33920) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xe4Ey-0005xm-Bb for control@debbugs.gnu.org; Tue, 14 Oct 2014 11:42:24 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Xe4Ey-0005ZN-3C for control@debbugs.gnu.org; Tue, 14 Oct 2014 11:42:24 -0400 Date: Tue, 14 Oct 2014 11:42:24 -0400 Message-Id: Subject: control message for bug 18710 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) unarchive 15408 merge 15408 18710 From unknown Fri Jun 20 18:23:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 12 Nov 2014 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator