emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: Allen Li <vianchielfaura@gmail.com>
Cc: emacs-orgmode@gnu.org, Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: Re: Bug: org-2ft and/or float-time is wrong [9.1.2 (9.1.2-22-ga2a034-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20171023/)]
Date: Wed, 01 Nov 2017 18:18:15 +1100	[thread overview]
Message-ID: <87tvyelb60.fsf@gmail.com> (raw)
In-Reply-To: <CAJr1M6e9Juyqhz58NfGjqJE7Z4dhi91X7G9ALhEF7n6sjd5JKw@mail.gmail.com>


My preferences would be

1. If a timestamp does not include the TZ, then assume the local TZ
2. If a timestamp does include the TZ, honour that TZ
3. If the timestamp does not include a time component, default to 0:00:0
for the local TZ
4. org-2ft should not enforce the UTC TZ. I agree this is incorrect.

Rationale is that the user should have ability to fully control how
their timestamps are represented. However, adding the TZ is probably
just a pain for the majority of use cases, so defaulting to the local
(wall) TZ is OK provided you can override this consistently by adding
explicit TZ values.

However, there is some devil in the details we need to work out. For
example, should we support both TZ names (like AEDT or Australia/Sydney)
and POSIX style +11/+11:00/+1100, should we add an option to tell org to
always add TZ info in timestamps which include time components and if
so, how complex will this need to be e.g. handle setting a future/past
timestamp which is in a different (daylight savings) offset and what
about the additional complexity in dealing with timestamp calculations
where dates might be in different offsets due to daylight savings -
while all quite possible, it does add significant complexity and this
may have adverse impact on performance. Not to say we shouldn't do it,
just that it will take significant work.

I suspect just the first part won't have major impact - at least no more
than enforcing UTC in org-2ft.

Tim

P.S. when you start to think about it, it is easy to see how Java
screwed up this stuff so badly!


Allen Li <vianchielfaura@gmail.com> writes:

> On Tue, Oct 31, 2017 at 10:41 PM, Tim Cross <theophilusx@gmail.com> wrote:
>>
>> I think this whole issue really requires a lot more analysis and
>> design. Just removing or cancelling various commits is unlikely to
>> improve matters and could result in new problems.
>
> You're right, but the new behavior was introduced fairly recently.
>
>> For org to work correctly, especially when interacting/interfacing with
>> other systems, such as external calendars, the use of timestamps must
>> handle timezones consistently and accurately. This is the only way that
>> any daylight savings calculations will work consistently as different
>> timezones have different rules for when daylight savings start/finish
>> (and these rules change).
>>
>> If the tests only support UTC/GMT timezone, they are poor tests and need
>> to be adjusted to use whatever the timezone is on the system running the
>> tests.
>>
>> I also wonder if there is some inconsistencies in how timestamps without
>> a time component are being handled. It would be good to know if the
>> issues Alan has observed exist when a full timestamp is used ie. one
>> with HH:MM:SS.s and not just date. If timezones are not been applied
>> consistently when choosing the default i.e. 00:00:00.0 with respect to
>> timezone offset, you will get inconsistencies when moving between
>> displayed (string) and calculated (number/seconds since epoch) values.
>
> I think we first need to agree on how Org mode should handle
> time.  What seems most natural to me is:
>
> * Floating point timestamps are Unix timestamps, seconds since Epoch.
> * Org format time strings are interpreted in the local machine's time zone.
>
> Let us assume that my timezone is UTC-07.  In that case,
> <2017-10-30> should be interpreted as 2017-10-30T00:00:00-0700,
> or 2017-10-30T07:00:00+0000.
>
> <2017-10-30>            1509346800.0    2017-10-30T00:00:00-0700
>  2017-10-30T07:00:00+0000
> <2017-10-30 12:34>      1509392040.0    2017-10-30T12:34:00-0700
>  2017-10-30T19:34:00+0000
>
> Currently, org-2ft returns:
>
> <2017-10-30>            1509321600.0    2017-10-29T17:00:00-0700
>  2017-10-30T00:00:00+0000
> <2017-10-30 12:34>      1509366840.0    2017-10-30T05:34:00-0700
>  2017-10-30T12:34:00+0000
>
> This is because org-2ft calls org-parse-time-string with t for
> zone, i.e. parse the time string as though it were UTC.  That
> should be apparent from the last column.
>
> Hopefully, we can agree that the former is the desired behavior.
> Working on this assumption, org-2ft should be changed to the
> original behavior, i.e., to not parse time strings as UTC.
>
> The question then becomes, what breaks if we just naively change
> org-2ft?  The new behavior was only added to org-2ft four months
> ago, so worst case is reverting every time-related change in the
> interim puts us back four months in time-related logic.
>
> But looking through the history, most of the time-related changes
> in the interim were to fix regressions caused by the initial
> logic change.  If we revert the original "regression", then those
> interim changes are also not needed.


-- 
Tim Cross

  reply	other threads:[~2017-11-01  7:18 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31  0:40 Bug: org-2ft and/or float-time is wrong [9.1.2 (9.1.2-22-ga2a034-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20171023/)] Allen Li
2017-10-31  4:33 ` Allen Li
2017-10-31 18:23   ` Nicolas Goaziou
2017-10-31 18:35     ` Allen Li
2017-10-31 18:52       ` Nicolas Goaziou
2017-11-01  5:07         ` Allen Li
2017-11-01  5:41           ` Tim Cross
2017-11-01  6:26             ` Allen Li
2017-11-01  7:18               ` Tim Cross [this message]
2017-11-01  8:28                 ` Allen Li
2017-11-01 13:09                   ` Tim Cross
2017-11-01 19:14                     ` Allen Li
2017-11-01 19:21                       ` Allen Li
2017-11-02  0:09                         ` Tim Cross
2017-11-02  0:26                           ` Allen Li
2017-11-02  3:27                             ` Tim Cross
2017-11-02  4:05                               ` Allen Li
2017-11-02  4:28                                 ` Allen Li
2017-11-02  4:49                                   ` Allen Li
2017-11-02  4:56                                 ` Tim Cross
2017-11-02  5:12                                   ` Allen Li
2017-11-02 16:19                                     ` Nick Dokos
2017-11-02 19:56                                     ` Tim Cross
2017-11-01 20:55           ` Nicolas Goaziou
2017-11-02  0:10             ` Allen Li
2017-11-02  9:35               ` Nicolas Goaziou
2017-11-02 11:12                 ` Tim Cross

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=87tvyelb60.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    --cc=vianchielfaura@gmail.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).