emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: thunk2@arcor.de (Thomas Plass)
To: Martin Schroeder <mkschreder.uk@googlemail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Incorrect clock duration calculation
Date: Tue, 7 May 2019 21:30:08 +0200	[thread overview]
Message-ID: <23761.56512.441516.349535@AGAME7.local> (raw)
In-Reply-To: Your message of Tuesday, May 7 2019 11:07:58 (ID: <CAGmj6qvs+W==0quSrkXs9cvE5Le7E3Onhe757xR3XzR+KBQe2Q@mail.gmail.com>).

Note that the day starts at 00:00 and ends at 24:00.  So:

Martin Schroeder wrote at 11:07 on May 7, 2019:
: For example, this should produce 2:00 duration:
: CLOCK: [2019-04-19 Fri 22:00]--[2019-04-19 Fri 00:00] => -22:00

It will if you change [2019-04-19 Fri 00:00] to [2019-04-19 Fri 24:00].

: I tried this, but id did not work either:
: CLOCK: [2019-04-19 Fri 22:00]--[2019-04-19 Sat 00:00] => -22:00

Day name abbreviations ("Fri", "Sat") in timestamps are really for
human consumption.  Org doesn't attach a lot of meaning to them.
Hell, since they use a setting from `calendar', they are subject to
localisation.  Note that

[2019-04-19 00:00]
[2019-04-19 Sa 00:00]
[2019-04-19 Sat 00:00]
[2019-04-19 fooble 00:00]

work the same as Org is agnostic about the non-whitespace string
between the date and the time (as long as it doesn't contain
whitespace itself).

: This should produce 3:00 but it gives -21 even though the end time is
: later than start time:
: CLOCK: [2019-04-19 Fri 22:00]--[2019-04-19 Sat 01:00] => -21:00

No, the end time preceeds the start time.  The encoded duration starts
at 1am and ends at 10pm on the same day.  If you want to cross day
boundaries then the dates must be different in the timestamps.
"2019-04-20" is what you want in the second one:

CLOCK: [2019-04-19 Fri 22:00]--[2019-04-20 Sat 01:00] =>  3:00

Regards,

Thomas

      parent reply	other threads:[~2019-05-07 19:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  9:07 Incorrect clock duration calculation Martin Schroeder
2019-05-07 14:02 ` Julius Dittmar
2019-05-07 14:07 ` Jude DaShiell
2019-05-07 19:30 ` Thomas Plass [this message]

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=23761.56512.441516.349535@AGAME7.local \
    --to=thunk2@arcor.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=mkschreder.uk@googlemail.com \
    /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).