all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Max Nikulin <manikulin@gmail.com>,
	emacs-orgmode@gnu.org, 54764@debbugs.gnu.org
Subject: bug#54764: encode-time: make DST and TIMEZONE fields of the list argument optional ones
Date: Fri, 15 Apr 2022 12:14:35 +1000	[thread overview]
Message-ID: <87lew7gk1q.fsf@gmail.com> (raw)
In-Reply-To: <52fb10fb-892a-f273-3be8-28793f27e204@cs.ucla.edu>


Paul Eggert <eggert@cs.ucla.edu> writes:

> On 4/14/22 06:19, Max Nikulin wrote:
>
>>  date-time + "America/Los_Angeles" input should not be reduced to timezone offset
>> in the output.
>
> It depends on the application. For some applications (e.g., generating "Date:" lines
> in email), it is entirely correct to output a timestamp like "14 Apr 2022 15:16:04
> -0700", thus losing the fact that the timestamp was generated with
> TZ="America/Los_Angeles".
>
>> Zone internal object or identifier is important for calculation of other date-time values based on the origin value.
>
> Again, that depends on the application. It's typically wrong to store an old
> timestamp in a form like "1950-07-01 00:00 Europe/Lisbon", because there is no
> standard for what "Europe/Lisbon" means. If you update your copy of TZDB, or
> interpret such a timestamp on another computer, that can change the interpretation of
> such a timestamp. In this particular case, a change in TZDB release 2021b altered the
> interpretation of this old timestamp because we discovered that DST was observed in
> 1950 in Portugal.
>
> If you want to keep the TZDB identifier for advice about how to interpret dates
> relative to a timestamp, that's fine. But you should keep the UT offset in addition
> to the TZDB identifier, if you want your app to be fully accurate and useful. For
> example, you should store "1950-07-01 00:00:00 +0000 Europe/Lisbon" for a timestamp
> generated by TZDB release 2021a, so that when you interpret the timestamp in release
> 2021b you'll have an idea of what you're dealing with.
>

I think this is a very important point. Timezone data is not static. If
you only record the timezone name, offsets will be calculated using the
current definition, which may not be correct for past timestamps.

A good example of this is the DST values and the date when a TZ
transitions between DST and non-DST periods. That date can change,
either temporarily or permanently. That change can be days or even
weeks. Any date related calculations which only have knowledge about TZ
names and not the specific offset of a timestamp can therefore be out by
a significant amount.





WARNING: multiple messages have this Message-ID (diff)
From: Tim Cross <theophilusx@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Max Nikulin <manikulin@gmail.com>,
	emacs-orgmode@gnu.org, 54764@debbugs.gnu.org
Subject: Re: bug#54764: encode-time: make DST and TIMEZONE fields of the list argument optional ones
Date: Fri, 15 Apr 2022 12:14:35 +1000	[thread overview]
Message-ID: <87lew7gk1q.fsf@gmail.com> (raw)
In-Reply-To: <52fb10fb-892a-f273-3be8-28793f27e204@cs.ucla.edu>


Paul Eggert <eggert@cs.ucla.edu> writes:

> On 4/14/22 06:19, Max Nikulin wrote:
>
>>  date-time + "America/Los_Angeles" input should not be reduced to timezone offset
>> in the output.
>
> It depends on the application. For some applications (e.g., generating "Date:" lines
> in email), it is entirely correct to output a timestamp like "14 Apr 2022 15:16:04
> -0700", thus losing the fact that the timestamp was generated with
> TZ="America/Los_Angeles".
>
>> Zone internal object or identifier is important for calculation of other date-time values based on the origin value.
>
> Again, that depends on the application. It's typically wrong to store an old
> timestamp in a form like "1950-07-01 00:00 Europe/Lisbon", because there is no
> standard for what "Europe/Lisbon" means. If you update your copy of TZDB, or
> interpret such a timestamp on another computer, that can change the interpretation of
> such a timestamp. In this particular case, a change in TZDB release 2021b altered the
> interpretation of this old timestamp because we discovered that DST was observed in
> 1950 in Portugal.
>
> If you want to keep the TZDB identifier for advice about how to interpret dates
> relative to a timestamp, that's fine. But you should keep the UT offset in addition
> to the TZDB identifier, if you want your app to be fully accurate and useful. For
> example, you should store "1950-07-01 00:00:00 +0000 Europe/Lisbon" for a timestamp
> generated by TZDB release 2021a, so that when you interpret the timestamp in release
> 2021b you'll have an idea of what you're dealing with.
>

I think this is a very important point. Timezone data is not static. If
you only record the timezone name, offsets will be calculated using the
current definition, which may not be correct for past timestamps.

A good example of this is the DST values and the date when a TZ
transitions between DST and non-DST periods. That date can change,
either temporarily or permanently. That change can be days or even
weeks. Any date related calculations which only have knowledge about TZ
names and not the specific offset of a timestamp can therefore be out by
a significant amount.


  reply	other threads:[~2022-04-15  2:14 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 12:37 bug#54764: encode-time: make DST and TIMEZONE fields of the list argument optional ones Max Nikulin
2022-04-09  7:52 ` Paul Eggert
2022-04-09 11:36   ` Max Nikulin
2022-04-10  3:57   ` Max Nikulin
2022-04-13 14:40   ` Max Nikulin
2022-04-13 14:40     ` Max Nikulin
2022-04-13 18:35     ` Paul Eggert
2022-04-13 18:35       ` Paul Eggert
2022-04-14 13:19       ` Max Nikulin
2022-04-14 13:19       ` Max Nikulin
2022-04-14 22:46         ` Paul Eggert
2022-04-15  2:14           ` Tim Cross [this message]
2022-04-15  2:14             ` Tim Cross
2022-04-15 17:23           ` Max Nikulin
2022-04-16 19:23             ` Paul Eggert
2022-04-21 16:59               ` Max Nikulin
2022-04-21 16:59               ` Max Nikulin
2022-04-16 19:23             ` Paul Eggert
2022-04-19  2:02             ` Paul Eggert
2022-04-19  2:02               ` Paul Eggert
2022-04-19  5:50               ` Eli Zaretskii
2022-04-19 22:22                 ` Paul Eggert
2022-04-19 22:22                   ` Paul Eggert
2022-04-20  7:23                   ` Eli Zaretskii
2022-04-20  7:23                   ` Eli Zaretskii
2022-04-20 18:19                     ` Paul Eggert
2022-04-20 18:19                       ` Paul Eggert
2022-04-20 18:41                       ` Eli Zaretskii
2022-04-20 18:41                         ` Eli Zaretskii
2022-04-20 19:01                         ` Paul Eggert
2022-04-20 19:01                         ` Paul Eggert
2022-04-20 19:14                           ` Eli Zaretskii
2022-04-20 19:23                             ` Paul Eggert
2022-04-20 19:30                               ` Eli Zaretskii
2022-04-20 19:30                                 ` Eli Zaretskii
2022-04-21  0:11                                 ` Paul Eggert
2022-04-21  0:11                                 ` Paul Eggert
2022-04-21  6:44                                   ` Eli Zaretskii
2022-04-21 15:30                                     ` Max Nikulin
2022-04-21 15:58                                       ` Eli Zaretskii
2022-04-21 17:23                                         ` Max Nikulin
2022-04-21 18:46                                           ` Eli Zaretskii
2022-04-21 23:56                                     ` Paul Eggert
2022-04-21 23:56                                     ` Paul Eggert
2022-04-22  5:01                                       ` Eli Zaretskii
2022-04-22  5:01                                       ` Eli Zaretskii
2022-04-22  5:23                                       ` Time resolution in Emacs " Eli Zaretskii
2022-04-22 18:22                                         ` Paul Eggert
2022-04-22 18:52                                           ` Corwin Brust
2022-04-22 21:26                                             ` Paul Eggert
2022-04-23  6:27                                               ` Time resolution in Emacs Eli Zaretskii
2022-04-24  0:56                                                 ` Paul Eggert
2022-04-24  6:10                                                   ` Eli Zaretskii
2022-04-24 11:47                                                     ` Max Nikulin
2022-04-24 12:23                                                       ` Eli Zaretskii
2022-04-25 15:32                                                     ` Paul Eggert
2022-04-25 16:01                                                       ` Eli Zaretskii
2022-04-22 19:35                                           ` Time resolution in Emacs argument optional ones Eli Zaretskii
2022-04-22 21:52                                             ` Paul Eggert
2022-04-23  6:51                                               ` Time resolution in Emacs Eli Zaretskii
2022-04-25 15:34                                                 ` Paul Eggert
2022-04-25 16:10                                                   ` Eli Zaretskii
2022-04-25 16:38                                                     ` Paul Eggert
2022-04-25 16:57                                                       ` Eli Zaretskii
2022-04-25 16:54                                                   ` Max Nikulin
2022-04-25 17:02                                                     ` Eli Zaretskii
2022-04-25 19:27                                                     ` Paul Eggert
2022-04-29 15:19                                                       ` Max Nikulin
2022-04-29 16:07                                                         ` Eli Zaretskii
2022-04-21  6:44                                   ` bug#54764: encode-time: make DST and TIMEZONE fields of the list argument optional ones Eli Zaretskii
2022-04-20 19:23                             ` Paul Eggert
2022-04-20 19:14                           ` Eli Zaretskii
2022-04-23 14:35                       ` Bernhard Voelker
2022-04-23 14:35                       ` Bernhard Voelker
2022-04-19  5:50               ` Eli Zaretskii
2022-04-20 15:07               ` Max Nikulin
2022-04-20 15:07               ` Max Nikulin
2022-04-20 18:29                 ` Paul Eggert
2022-04-20 18:29                   ` Paul Eggert
2022-04-25 15:30                   ` Max Nikulin
2022-04-25 15:30                     ` Max Nikulin
2022-04-25 15:37                     ` Paul Eggert
2022-04-25 19:49                       ` Paul Eggert
2022-04-25 19:49                         ` Paul Eggert
2022-04-30 11:22                         ` Max Nikulin
2022-04-30 11:22                           ` Max Nikulin
2022-05-01  2:32                           ` Paul Eggert
2022-05-01  2:32                             ` Paul Eggert
2022-05-01 17:15                             ` Max Nikulin
2022-05-01 17:15                             ` Max Nikulin
2022-04-25 15:37                     ` Paul Eggert
2022-04-15 17:23           ` Max Nikulin
2022-04-14 22:46         ` Paul Eggert
2022-04-13 15:12   ` Max Nikulin
2022-04-13 15:12   ` Max Nikulin
2022-04-16 16:26   ` Max Nikulin
2022-04-16 16:26   ` Max Nikulin
2022-04-17  1:58     ` Paul Eggert
2022-04-17  1:58     ` Paul Eggert
2022-04-20 16:56       ` Max Nikulin
2022-04-20 16:56         ` Max Nikulin
2022-04-20 19:17         ` Paul Eggert
2022-04-20 19:17         ` Paul Eggert
2022-04-09  7:52 ` Paul Eggert
     [not found] ` <handler.54764.D54764.165091617725815.notifdone@debbugs.gnu.org>
2022-04-25 21:16   ` Glenn Morris
2022-04-26  1:18     ` Paul Eggert

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

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

  git send-email \
    --in-reply-to=87lew7gk1q.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=54764@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.