emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#54764: encode-time: make DST and TIMEZONE fields of the list arg


From: Tim Cross
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
User-agent: mu4e 1.7.12; emacs 28.1.50

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 via email to

[Prev in Thread] Current Thread [Next in Thread]