From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: clocktable interprets tstart/tend incorrectly, maybe? [9.0.9 (9.0.9-636-gd39ccc-elpaplus @ /tmp/emacs/.emacs.d/elpa/org-plus-contrib-20170709/)] Date: Mon, 10 Jul 2017 10:59:06 +0200 Message-ID: <87tw2kwtut.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUUXD-0001G3-No for emacs-orgmode@gnu.org; Mon, 10 Jul 2017 04:59:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUUX9-0006Ql-Rt for emacs-orgmode@gnu.org; Mon, 10 Jul 2017 04:59:15 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:53822) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUUX9-0006Q1-K7 for emacs-orgmode@gnu.org; Mon, 10 Jul 2017 04:59:11 -0400 In-Reply-To: (Dale Sedivec's message of "Sun, 9 Jul 2017 15:46:27 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Dale Sedivec Cc: emacs-orgmode@gnu.org Hello, Dale Sedivec writes: > Hi! I think clocktables may be parsing time zones incorrectly in :tstart > and :tend, leading to incorrect output. Steps to reproduce: > > 1. Start a fresh Emacs within that same along the lines of: > > ~~~~~~ > mkdir /tmp/emacs > TZ=America/Chicago HOME=/tmp/emacs /path/to/emacs > ~~~~~~ > > I *think* setting TZ to a non-UTC time zone is important to reproduce this. > > 2. Install latest org-mode from Git. I did this via package-install-file > on a package I built from a Git checkout of the org-mode repository. > > 3. Open an org-mode buffer, e.g. C-x C-f ~/test.org RET. > > 4. Insert: > > ~~~~~~ > > #+BEGIN: clocktable :maxlevel 2 :scope file :step day :tstart "<2017-07-02 > Sun>" :tend "<2017-07-09 Sun>" > > #+END: > ~~~~~~ > > 5. Save the buffer. > > 6. Move point to the start of that dblock and C-c C-c to update it. > > Expected results: First step is "Daily report: [2017-07-02 Sun]" which > matches the :tstart. > > Actual results: First step is "Daily report: [2017-07-01 Sat]", the day > before the :tstart date. The last step is also 2017-07-07, not 2017-07-08 > as I was expecting. > > I notice that as of 112c5ba479d, org-clocktable-steps parses :tstart and > :tend with the ZONE argument to org-parse-time-string as T. I think this > is causing org-parse-time-string to parse these user-entered dates as UTC > rather than the user's local time as I would have expected. Changing > org-clocktable-steps from doing (org-parse-time-string ts nil t) > to (org-parse-time-string ts nil nil), and then the same for te as well, > seems to fix this problem. Fixed. Thank you for the report and the analysis. Regards, -- Nicolas Goaziou