[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Bug: clocktable interprets tstart/tend incorrectly, maybe? [9.0.
From: |
Nicolas Goaziou |
Subject: |
Re: [O] 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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Hello,
Dale Sedivec <address@hidden> 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