On Mon, Jul 10, 2017 at 3:59 AM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Dale Sedivec <d...@codefu.org> writes:
>
[...]

> > 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.
>

Thank you as always Nicolas!  You fixed the time zone for :tstart in
60eda8e4ec4.  However, I think the parsing of :tend (locally bound as te)
eight lines below that needs the same fix.  Diff attached this time, just
to demonstrate what I'm talking about.  (Sorry I don't send more patches,
but I have not updated my copyright assignment to reflect my new employer.)

Steps to reproduce:

* Start Emacs 25.1 in an empty $HOME with TZ=America/Chicago

* Install org-mode HEAD

* Insert the following into an org-mode buffer and update the dblock:

~~~~~~
* Test
  :LOGBOOK:
  CLOCK: [2017-07-15 Sat 00:01]--[2017-07-15 Sat 01:01] =>  1:00
  :END:
#+BEGIN: clocktable :maxlevel 2 :scope subtree :tstart "<2017-07-09 Sun>"
:tend "<2017-07-16 Sun>" :step day
#+END:
~~~~~~

Expected result: The last step in the clock table for 2017-07-15 shows 1
hour

Actual result: The last step in the clock table for 2017-07-15 shows 0 hours

Thanks again,
Dale
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 8e04aec2dd..4164c92aba 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2710,8 +2710,7 @@ LEVEL is an integer.  Indent by two spaces per level 
above 1."
       (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute te)))
        (setq te (float-time (encode-time 0 0 0 day month year)))))
      (te
-      (setq te (float-time
-               (apply #'encode-time (org-parse-time-string te nil t))))))
+      (setq te (float-time (apply #'encode-time (org-parse-time-string te))))))
     (setq tsb
          (if (eq step0 'week)
              (- ts (* 86400 (- (nth 6 (decode-time (seconds-to-time ts))) ws)))

Reply via email to