emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Dale Sedivec <dale@codefu.org>
Cc: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <87tw2kwtut.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAEj9N4+EaxYAeAgkus6q6X94A+QCov5vDjeim0_TcwRxOUexpw@mail.gmail.com> (Dale Sedivec's message of "Sun, 9 Jul 2017 15:46:27 -0500")

Hello,

Dale Sedivec <dale@codefu.org> 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

  reply	other threads:[~2017-07-10  8:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-09 20:46 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/)] Dale Sedivec
2017-07-10  8:59 ` Nicolas Goaziou [this message]
2017-07-15  6:15   ` Dale Sedivec
2017-07-24  7:43     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tw2kwtut.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=dale@codefu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).