emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
@ 2023-01-13  8:56 Daryl Manning
  2023-01-13 12:51 ` Tim Cross
                   ` (2 more replies)
  0 siblings, 3 replies; 330+ messages in thread
From: Daryl Manning @ 2023-01-13  8:56 UTC (permalink / raw)
  To: Org-mode

[-- Attachment #1: Type: text/plain, Size: 1799 bytes --]

Following on from thread at
https://www.reddit.com/r/orgmode/comments/zrppqw/

[First off, I just wanted to say thank you to everyone that works on
org-mode. It is a wonder.]

While I realize a few kicks at this can may have been taken, I wanted to
(re-)propose Timezone support in org-mode. The world is much less local
these days and we're all more remote and coordinating globally these days.

*Background*

1. org-time-stamp-formats TZ currently only affects display and exports
2. org-agenda itself is not TZ aware
3. Several discussions on this have taken place over time
4. Concerns raise included breaking backwards compatibility

*Proposal*

1. org-mode sets an optional variable (org-timezone-aware t) which enables
TZ
2. org-agenda needs a way to determine which timezone it is in
3. Once enabled, any timestamp not exhibiting a TZ in it is considered
"local time" wherever that is (I do not think UTC would work for this)
4. org-agenda can calc local based on TZ differences

I understand this is by no means trivial and quite gnarly with DST and such
to figure out but I do believe libs exists to deal with that heavy lifting.
Currently, it does feel like a hole in org-mode as a 21st century organizer
(disclaimer: digital nomading so might feel it more keenly). Also, just
interested in making org-mode a more awesome tool for everybody.

I'd love an understanding of the alluded to reservations raised in the
reddit thread and in the mailing list threads mentioned that the format
change might break things (I was unsure if that was referring to say, how
time ranges were handled, or how say date ranges got dealt with (for
example, say a flight from Singapore to Vancouver which takes off in one
time zone and lands in another - something that is often in my cal.).

thanks!
Daryl.

[-- Attachment #2: Type: text/html, Size: 2335 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-13  8:56 [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Daryl Manning
@ 2023-01-13 12:51 ` Tim Cross
  2023-01-14  6:27   ` Daryl Manning
  2023-01-14 11:18   ` Ihor Radchenko
  2023-01-13 19:06 ` [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Jean Louis
  2023-01-14  5:14 ` Samuel Wales
  2 siblings, 2 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-13 12:51 UTC (permalink / raw)
  To: Daryl Manning; +Cc: emacs-orgmode


Daryl Manning <daryl@wakatara.com> writes:

> Following on from thread at https://www.reddit.com/r/orgmode/comments/zrppqw/
>
> [First off, I just wanted to say thank you to everyone that works on org-mode. It is a wonder.]
>
> While I realize a few kicks at this can may have been taken, I wanted to (re-)propose Timezone support in org-mode. The
> world is much less local these days and we're all more remote and coordinating globally these days.
>
> *Background*
>
> 1. org-time-stamp-formats TZ currently only affects display and exports
> 2. org-agenda itself is not TZ aware
> 3. Several discussions on this have taken place over time
> 4. Concerns raise included breaking backwards compatibility
>
> *Proposal*
>
> 1. org-mode sets an optional variable (org-timezone-aware t) which enables TZ
> 2. org-agenda needs a way to determine which timezone it is in
> 3. Once enabled, any timestamp not exhibiting a TZ in it is considered "local time" wherever that is (I do not think UTC
> would work for this)
> 4. org-agenda can calc local based on TZ differences
>
> I understand this is by no means trivial and quite gnarly with DST and such to figure out but I do believe libs exists to
> deal with that heavy lifting. Currently, it does feel like a hole in org-mode as a 21st century organizer (disclaimer:
> digital nomading so might feel it more keenly). Also, just interested in making org-mode a more awesome tool for
> everybody. 
>
> I'd love an understanding of the alluded to reservations raised in the reddit thread and in the mailing list threads
> mentioned that the format change might break things (I was unsure if that was referring to say, how time ranges were
> handled, or how say date ranges got dealt with (for example, say a flight from Singapore to Vancouver which takes off in
> one time zone and lands in another - something that is often in my cal.). 
>

I agree this would be a great feature to add. However, after having
looked at it in some detail, I realise that not only is it not a trivial
task, it is actually a very large and complex task and will require
extensive work which will almost certainly result in breakage with
regards to backwards compatibility.

At the risk of over simplifying the matter, I would suggest the big
challenge here is that there are two somewhat competing (and
conflicting) use cases. On one hand, you want a high level abstraction
which makes working with dates and times easy and clear. TO some extent,
that is what we have now. On the other hand, we need something far more
complex which is able to handle multiple time zones. This means being
able to handle both base timezone offsets as well as offset adjustments
for things like daylight savings time. There is a lot of hidden
complexity here. You have to handle the fact that daylight saving
chang-over dates/times are dynamic i.e. not necessarily the same every
year. This adds the additional complexity of having to somehow track
historical information regarding such changes, which isn't as readily
accessible in a consistent manner on all platforms.

Then there is the other 'messy' stuff. For example, when calculating
time ranges and number of days, hours/ minutes between two dates you
need to remember to add/remove the hour if the range crosses over a
daylight savings period. Similarly you need to ensure you make the
correct adjustment when changing timezones (consider emacs on a laptop
for someone who travels a lot between different time zones). Not only do
you need to take into account the different timezone offset, you also
need to look at the date and then adjust according to the timezone
offset for the current timezone at the time of the timestamp rather than
just considering the current time offset.  

I expect what is needed is an 'internal' UTC based representation which
is used for all calculations and an 'interface' layer, which converts
the UTC representation into the local display representation for
consumption by humans. The problem with this is that it is likely to
break the core feature of org files i.e. that they are in plain text. I
guess we could possibly do somehting clever with overlays such that UTC
date/times are rendered/presented in local time format. However, we
would then also require some type of interface for users to enter
dates/times (to ensure they are converted to the correct UTC internal
format).

However, the real challenge here is that this is a very large piece of
work and it needs someone who is prepared to take it on. I suspect until
someone who needs to scratch this itch sufficiently comes along, this is
a feature which will be unlikely to make it to the top of the todo
list. There are simply far too many existing feature improvements and
additions people will prefer to work on before taking on this
one. Things are made more difficult because it isn't the sort of task
which can be achieved with small increments over time. This is more
likely to be something which needs to be developed in a feature branch,
which once it reaches a sufficient level of completeness can be used and 
verified working for a wide variety of environments before then working
out how to fold it back into the core system and handle whatever change
management will be necessary. 


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-13  8:56 [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Daryl Manning
  2023-01-13 12:51 ` Tim Cross
@ 2023-01-13 19:06 ` Jean Louis
  2023-01-14  7:12   ` Max Nikulin
  2023-01-14  5:14 ` Samuel Wales
  2 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-13 19:06 UTC (permalink / raw)
  To: Daryl Manning; +Cc: Org-mode

* Daryl Manning <daryl@wakatara.com> [2023-01-13 11:59]:
> *Background*
> 
> 1. org-time-stamp-formats TZ currently only affects display and exports
> 2. org-agenda itself is not TZ aware
> 3. Several discussions on this have taken place over time
> 4. Concerns raise included breaking backwards compatibility
> 
> *Proposal*
> 
> 1. org-mode sets an optional variable (org-timezone-aware t) which enables
> TZ
> 2. org-agenda needs a way to determine which timezone it is in
> 3. Once enabled, any timestamp not exhibiting a TZ in it is considered
> "local time" wherever that is (I do not think UTC would work for this)
> 4. org-agenda can calc local based on TZ differences

Totally understandable. 

In my opinion time functions shall be implemented, if they are not, in
Emacs generally, not only Org specific. 

This is good for review as related to PostgreSQL database:

https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_timestamp_.28without_time_zone.29

Analogously it would be best that Org becomes time zone aware.

It would mean that timestamps become time zone aware. Something like this:

<2023-01-15 Sun +1>

When timestamp becomes time zone aware, then as preliminary option it
would be possible to update all the timestamps in an Org file for
personal use.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-13  8:56 [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Daryl Manning
  2023-01-13 12:51 ` Tim Cross
  2023-01-13 19:06 ` [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Jean Louis
@ 2023-01-14  5:14 ` Samuel Wales
  2023-01-14  5:51   ` Tom Gillespie
  2 siblings, 1 reply; 330+ messages in thread
From: Samuel Wales @ 2023-01-14  5:14 UTC (permalink / raw)
  To: Daryl Manning; +Cc: Org-mode

sounds complex.  but if timestamp syntax is to be changed, my personal
"like a broken record" view is that possibly extensible syntax could
be used, depending on the number of places ts parsing is done
currently.

i.e. on whether current ts parsing is intermingled in core org code
with ts semantics and scattered all over org.  although, i suspect a
lot o that woul dneed changing if you wanted to iplement tz anyway.

org has kept deveoping new syntax; es was designed to stop that being
necessary.  i prefer less proliferation.  es allows a maximal amount
of flexibility using the same code for handling every aspect of it.
it is sexp data.

thus if favorable and tz is still desirable perhaps those who want to
use timezones would use es for tses, and a :tz keyword.  if desired
the org buffer can look like today's tses with whatever tz cookie
syntax you want.  it would not need any parsing.  it would be
analogous to links not showing their brackets/url.  the cookie would
be for presentation only so need only be a line or two of code.

still, adding tz semantics to all of org's features and packages and
personal code for those who want it sounds complex.


On 1/13/23, Daryl Manning <daryl@wakatara.com> wrote:
> Following on from thread at
> https://www.reddit.com/r/orgmode/comments/zrppqw/
>
> [First off, I just wanted to say thank you to everyone that works on
> org-mode. It is a wonder.]
>
> While I realize a few kicks at this can may have been taken, I wanted to
> (re-)propose Timezone support in org-mode. The world is much less local
> these days and we're all more remote and coordinating globally these days.
>
> *Background*
>
> 1. org-time-stamp-formats TZ currently only affects display and exports
> 2. org-agenda itself is not TZ aware
> 3. Several discussions on this have taken place over time
> 4. Concerns raise included breaking backwards compatibility
>
> *Proposal*
>
> 1. org-mode sets an optional variable (org-timezone-aware t) which enables
> TZ
> 2. org-agenda needs a way to determine which timezone it is in
> 3. Once enabled, any timestamp not exhibiting a TZ in it is considered
> "local time" wherever that is (I do not think UTC would work for this)
> 4. org-agenda can calc local based on TZ differences
>
> I understand this is by no means trivial and quite gnarly with DST and such
> to figure out but I do believe libs exists to deal with that heavy lifting.
> Currently, it does feel like a hole in org-mode as a 21st century organizer
> (disclaimer: digital nomading so might feel it more keenly). Also, just
> interested in making org-mode a more awesome tool for everybody.
>
> I'd love an understanding of the alluded to reservations raised in the
> reddit thread and in the mailing list threads mentioned that the format
> change might break things (I was unsure if that was referring to say, how
> time ranges were handled, or how say date ranges got dealt with (for
> example, say a flight from Singapore to Vancouver which takes off in one
> time zone and lands in another - something that is often in my cal.).
>
> thanks!
> Daryl.
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14  5:14 ` Samuel Wales
@ 2023-01-14  5:51   ` Tom Gillespie
  2023-01-14  6:40     ` tomas
  2023-01-26 15:24     ` Org mode timestamps on the Moon ;] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Ihor Radchenko
  0 siblings, 2 replies; 330+ messages in thread
From: Tom Gillespie @ 2023-01-14  5:51 UTC (permalink / raw)
  To: Org-mode

Without wading too far into this at the moment,
timezones are an extremely tricky problem with
a whole bunch of design considerations. I am
reproducing the heading comment from laundry's
timestamp.rkt in its entirety here. Best!
Tom

https://github.com/tgbugs/laundry/blob/master/laundry/grammar/timestamp.rkt

; the org spec is currently silent on how org will handle dates beyond
; 0000 and 9999, the relevant standards for expanded representations
; are ISO 8601-1:2019,5.2.2.3 and ISO 8601-2:2019,8.4.3. The problem
; with expanded representations is that they require all parties to
; agree ahead of time how wide the year is and prefix with + and
; leading zeros, I am not sure that this is as robust as we would like
; 0000-01-01 is january first of the year zero, -0001-01-01 is jan
; first of the year 1BCE, and +10000-01-01 for jan 1 of 10000CE 5
; digits must be prefixed by the plus sign, the standard is not
; entirely clear, but I think that we could do PLUS digits HYPHEN
; or DIGIT-4 HYPHEN and everything would work out

; on a separate but related note, org timestamps are always in local
; time and do not currently support timezones, which is a problem

; further absurdities that are related to the timezone issue: the
; date/time implementation as a text format completely fails if
; authoring on another planet

; given my objective to ensure that org documents can be interpreted
; without having to stick stupid things like #+planet: mars in the
; header or risk your earthling readers getting incorrect dates --- I
; suggest that org switch to storing all dates and times in earth zulu
; time or with an offset as it stands, the timezone setting of the
; computer drafting the document must be known to determine what day
; it was etc. users could still draft using <2020-12-16> but C-c C-c
; would add the correct offset? actually this is tricky, because there
; are two cases, one where the location is clear, "napoleon on [1812-01-01]"
; and the other where it is not, the issue is that a single date refers
; to as many different time intervals as there are timezones and without
; knowing the timezone you don't know the date, similar issue if we were
; to try to convert to sols
; https://www.eecis.udel.edu/~mills/missions.html
; https://www.eecis.udel.edu/~mills/ipin.html
; https://en.wikipedia.org/wiki/Timekeeping_on_Mars
; HOWEVER having applied a bit more brain power to the problem, let's
; just assume that clock synchonization will happen between earth and
; mars so that the unix epoch could be synchronized between the frames
; probably with multiple reference stations in free fall and/or in deep
; space to account for gravitaitonal differences etc. so actually the
; only issue would be a practical notational one, or a UI one, since we
; can use timestamp with timezone or just straight epoc for this to work
; earth vs martian year/day is a much harder issue
; the org spec is currently silent on how org will handle dates beyond


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-13 12:51 ` Tim Cross
@ 2023-01-14  6:27   ` Daryl Manning
  2023-01-14 12:46     ` Jean Louis
  2023-01-14 11:18   ` Ihor Radchenko
  1 sibling, 1 reply; 330+ messages in thread
From: Daryl Manning @ 2023-01-14  6:27 UTC (permalink / raw)
  To: Tim Cross; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 7039 bytes --]

I agree this is perhaps not a trivial undertaking. It really depends on the
quality of date and time libraries that exist in the lisp ecosystem. For
example, in Rust I found my timezone woes in one of my own apps were
trivial due to the chronos package, but likewise the reliance of Go
depending on its underlying time and date type actually introduced a weird
timezone and DST bug in my own app.

Is/are there lisp packages which handle the complexity involved in time and
date difference calculations and DST changes? That would perhaps be the
first question. It makes things tremendously easier and would reduce much
of the work (perhaps to just the argument of the format and parsing the
datetime stamp and making org-agenda aware of which timezone it's in.).

To Jean Louis' point: using timestamps without timezones is a don't in much
of computing these days and perhaps hearkens back to the simpler age emacs
and org originated in.  =]  (kidding!).

My lips-fu is not adequate to taking this on myself so the issue of who
would want ot work on it over other features is perhaps the bigger
question. Could someone scope out the work and approach at least. I imagine
it is tricky and non-trivial, but perhaps less complex if good libraries
exist as above.

I'd simply make the timezone format a slowly to be evolved to standard over
time with exceptions as noted in my first note. not having tz in timestamps
was a "assume local" assumption and under-specification (or considered
"hidden".).

Daryl.


On Fri, Jan 13, 2023 at 8:34 PM Tim Cross <theophilusx@gmail.com> wrote:

>
> Daryl Manning <daryl@wakatara.com> writes:
>
> > Following on from thread at
> https://www.reddit.com/r/orgmode/comments/zrppqw/
> >
> > [First off, I just wanted to say thank you to everyone that works on
> org-mode. It is a wonder.]
> >
> > While I realize a few kicks at this can may have been taken, I wanted to
> (re-)propose Timezone support in org-mode. The
> > world is much less local these days and we're all more remote and
> coordinating globally these days.
> >
> > *Background*
> >
> > 1. org-time-stamp-formats TZ currently only affects display and exports
> > 2. org-agenda itself is not TZ aware
> > 3. Several discussions on this have taken place over time
> > 4. Concerns raise included breaking backwards compatibility
> >
> > *Proposal*
> >
> > 1. org-mode sets an optional variable (org-timezone-aware t) which
> enables TZ
> > 2. org-agenda needs a way to determine which timezone it is in
> > 3. Once enabled, any timestamp not exhibiting a TZ in it is considered
> "local time" wherever that is (I do not think UTC
> > would work for this)
> > 4. org-agenda can calc local based on TZ differences
> >
> > I understand this is by no means trivial and quite gnarly with DST and
> such to figure out but I do believe libs exists to
> > deal with that heavy lifting. Currently, it does feel like a hole in
> org-mode as a 21st century organizer (disclaimer:
> > digital nomading so might feel it more keenly). Also, just interested in
> making org-mode a more awesome tool for
> > everybody.
> >
> > I'd love an understanding of the alluded to reservations raised in the
> reddit thread and in the mailing list threads
> > mentioned that the format change might break things (I was unsure if
> that was referring to say, how time ranges were
> > handled, or how say date ranges got dealt with (for example, say a
> flight from Singapore to Vancouver which takes off in
> > one time zone and lands in another - something that is often in my
> cal.).
> >
>
> I agree this would be a great feature to add. However, after having
> looked at it in some detail, I realise that not only is it not a trivial
> task, it is actually a very large and complex task and will require
> extensive work which will almost certainly result in breakage with
> regards to backwards compatibility.
>
> At the risk of over simplifying the matter, I would suggest the big
> challenge here is that there are two somewhat competing (and
> conflicting) use cases. On one hand, you want a high level abstraction
> which makes working with dates and times easy and clear. TO some extent,
> that is what we have now. On the other hand, we need something far more
> complex which is able to handle multiple time zones. This means being
> able to handle both base timezone offsets as well as offset adjustments
> for things like daylight savings time. There is a lot of hidden
> complexity here. You have to handle the fact that daylight saving
> chang-over dates/times are dynamic i.e. not necessarily the same every
> year. This adds the additional complexity of having to somehow track
> historical information regarding such changes, which isn't as readily
> accessible in a consistent manner on all platforms.
>
> Then there is the other 'messy' stuff. For example, when calculating
> time ranges and number of days, hours/ minutes between two dates you
> need to remember to add/remove the hour if the range crosses over a
> daylight savings period. Similarly you need to ensure you make the
> correct adjustment when changing timezones (consider emacs on a laptop
> for someone who travels a lot between different time zones). Not only do
> you need to take into account the different timezone offset, you also
> need to look at the date and then adjust according to the timezone
> offset for the current timezone at the time of the timestamp rather than
> just considering the current time offset.
>
> I expect what is needed is an 'internal' UTC based representation which
> is used for all calculations and an 'interface' layer, which converts
> the UTC representation into the local display representation for
> consumption by humans. The problem with this is that it is likely to
> break the core feature of org files i.e. that they are in plain text. I
> guess we could possibly do somehting clever with overlays such that UTC
> date/times are rendered/presented in local time format. However, we
> would then also require some type of interface for users to enter
> dates/times (to ensure they are converted to the correct UTC internal
> format).
>
> However, the real challenge here is that this is a very large piece of
> work and it needs someone who is prepared to take it on. I suspect until
> someone who needs to scratch this itch sufficiently comes along, this is
> a feature which will be unlikely to make it to the top of the todo
> list. There are simply far too many existing feature improvements and
> additions people will prefer to work on before taking on this
> one. Things are made more difficult because it isn't the sort of task
> which can be achieved with small increments over time. This is more
> likely to be something which needs to be developed in a feature branch,
> which once it reaches a sufficient level of completeness can be used and
> verified working for a wide variety of environments before then working
> out how to fold it back into the core system and handle whatever change
> management will be necessary.
>

[-- Attachment #2: Type: text/html, Size: 8077 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14  5:51   ` Tom Gillespie
@ 2023-01-14  6:40     ` tomas
  2023-01-26 15:24     ` Org mode timestamps on the Moon ;] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Ihor Radchenko
  1 sibling, 0 replies; 330+ messages in thread
From: tomas @ 2023-01-14  6:40 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]

On Sat, Jan 14, 2023 at 12:51:31AM -0500, Tom Gillespie wrote:
> Without wading too far into this at the moment,
> timezones are an extremely tricky problem with
> a whole bunch of design considerations. I am
> reproducing the heading comment from laundry's
> timestamp.rkt in its entirety here. Best!
> Tom
> 
> https://github.com/tgbugs/laundry/blob/master/laundry/grammar/timestamp.rkt

[...]

> ; are two cases, one where the location is clear, "napoleon on [1812-01-01]"
> ; and the other where it is not, the issue is that a single date refers

Where location also includes time, sometimes (think DSTs). IMO, a timezone
is nice for added context, but meaningless without a concrete offset wrt
some agreed upon base (UTC, here on Earth, for example). Unless you use
clearly different shorthands (e.g. CST for Central Standard Time [1]
and CDT for Central Daylight Time).

The nice cherry on top of that is that this context info is sometimes
relevant and sometimes not. A regular appointment ("brush teeth") may
want to be seen relative to the current time zone (so it "moves" when
I travel from Berlin to New York), another ("Jitsi meeting with my
colleagues in Delhi, Dar-Es-Salam and Denpasar") might not.

I warmly recommend the Wikipedia page [2] on that topic.

An interesting problem :)

Cheers

[1] Eh. Nevermind that it also can mean Cuba Standard Time or China
   Standard Time.
[2] https://en.wikipedia.org/wiki/Time_zone

-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-13 19:06 ` [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Jean Louis
@ 2023-01-14  7:12   ` Max Nikulin
  2023-01-14  9:32     ` Tim Cross
  2023-01-14 13:08     ` Jean Louis
  0 siblings, 2 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-14  7:12 UTC (permalink / raw)
  To: emacs-orgmode

On 14/01/2023 02:06, Jean Louis wrote:
> This is good for review as related to PostgreSQL database:

I agree that PostgreSQL is an example of good implementation of 
time-related calculations.

> https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_timestamp_.28without_time_zone.29

I do not find this section enlightening in the context of this 
discussion. It is more related to storage formats of DB than to higher 
level aspects suitable for applications.

> It would mean that timestamps become time zone aware. Something like this:
> 
> <2023-01-15 Sun +1>

Welcome to another set of issues.

First of all, you have just date without specific time point. It may 
mean particular calendar day irrelevant to time zone. ICQ had a bug when 
they decide to store birth dates as timestamps. Significant fraction of 
users received automatic greetings on wrong day, a kind of off by one 
error. So dates must stored as dates omitting time and zone.

Let's assume <2023-01-15 Sun 09:00 +1>

It may be suitable for timestamps in the past, but future is more 
tricky. There is no problem if you are going to watch Lunar eclipse. 
However if your plan is to attend a local event there is a chance that 
you will arrive at wrong time. Sometimes offset of timezones is changed 
and it may happen between the moment when you added a scheduled time and 
the moment of the event.

Notice that Org timestamps already associated with a timezone, the one 
is set in libc (system timezone, or the one set for particular process). 
So daylight saving time and administrative time transitions should be 
taken into account. So Org timestamps may be ambiguous (mostly) 1 hour 
per year around backward time transition, e.g. for timezones having DST. 
This case explicitly specifying time offset helps to avoid uncertainty.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14  7:12   ` Max Nikulin
@ 2023-01-14  9:32     ` Tim Cross
  2023-01-14 11:08       ` Russell Adams
                         ` (2 more replies)
  2023-01-14 13:08     ` Jean Louis
  1 sibling, 3 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-14  9:32 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 14/01/2023 02:06, Jean Louis wrote:
>> This is good for review as related to PostgreSQL database:
>
> I agree that PostgreSQL is an example of good implementation of time-related calculations.
>
>> https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_timestamp_.28without_time_zone.29
>
> I do not find this section enlightening in the context of this discussion. It is more
> related to storage formats of DB than to higher level aspects suitable for applications.
>
>> It would mean that timestamps become time zone aware. Something like this:
>> <2023-01-15 Sun +1>
>
> Welcome to another set of issues.
>
> First of all, you have just date without specific time point. It may mean particular
> calendar day irrelevant to time zone. ICQ had a bug when they decide to store birth dates
> as timestamps. Significant fraction of users received automatic greetings on wrong day, a
> kind of off by one error. So dates must stored as dates omitting time and zone.
>
> Let's assume <2023-01-15 Sun 09:00 +1>
>
> It may be suitable for timestamps in the past, but future is more tricky. There is no
> problem if you are going to watch Lunar eclipse. However if your plan is to attend a local
> event there is a chance that you will arrive at wrong time. Sometimes offset of timezones
> is changed and it may happen between the moment when you added a scheduled time and the
> moment of the event.
>
> Notice that Org timestamps already associated with a timezone, the one is set in libc
> (system timezone, or the one set for particular process). So daylight saving time and
> administrative time transitions should be taken into account. So Org timestamps may be
> ambiguous (mostly) 1 hour per year around backward time transition, e.g. for timezones
> having DST. This case explicitly specifying time offset helps to avoid uncertainty.

If org was to add TZ capabilities to timestamps, the underlying format
would have to be UTC. My previous post where I suggested there was two
'layers', the underlying storage layer (used for calculations like
duration or comparison etc) and a presentation layer (what the human
sees, which is often in whatever their local TZ is). While overly
simplified, this is basically the approach used by postgres. If org mode
was to adopt TZ support for timestamps, I am quite certain that the only
sane way to do this will be to store the timestamps as UTC. Anything
else will just cause massive complications for anyone who moves between
different timezones as well as complicating calculations which cross
over DST transition points. 

I think most people are aware of the challenges of dealing with daylight
savings and the fact that the transition date+time into and out of DST
can change based on various criteria, including political whims
(e.g. Australia eastern DST transition date was changed in 2000 because
Sydney hosted the Olympics that year).  This means there is also an
historical context when calculating and formatting timestamps - it isn't
as easy as looking up to see if a location has DST and when the
transition date/time is - you have to determine that as of the date of
the timestamp.

THen we have the further complication of calendar changes and different
calendars. For example, many people don't realise that Russia didn't
adopt the Gregorian calendar until 1918. For example, the reference to
Napoleon earlier is more complicated when considered from a Russian
locale.

Daryl mentioned elsewhere in this thread that how hard this feature
would be depends largely on the available libraries for elisp with
respect to working with date/time values. Sadly, the available elisp
libraries are inadequate in this area. While many of the functions can
be called with an optional argument defining time zone information,
there is no library which can retrieve this information in a consistent
manner and which supports historical data lookup e.g. what were the DST
transition dates for NSW Australia in 1970 (trick questions, NSW didn't
adopt DST until 1971). The existing library functions are focused more
on simpler time calculations where time zone information is less
relevant i.e. running timers, timing command execution, comparing file
modification times etc. Sometimes, it is easy to forget that while Elisp
is powerful, it isn't really a general purpose programming language like
C or Rust or even CL and Scheme. It is primarily a programming language
focused  on a specific domain, the editor. While it has some great
libraries  it also has  anumber of areas where it lacks the sort of
sophistication we have grown to expect with more general purpose
languages.

A further complication is that accessing date and time related data is
very system dependent and there is no high level library which abstracts
this so that you  can easily get consistent results across all the
platforms Emacs runs on. Even the underlying data type can vary greatly
(i.e. some platforms use a 64 bit value while others only use a 32 bit one).

I therefore suspect that in order to consider adding this feature to org
it will first be necessary to add a more sophisticated date+time library
to Emacs - probably one which is able to interface more closely with OS
APIs - most likely, a C library with an Elisp API which is able to query
OS native TZ database information and which implements basic time
calculations and conversions between different TZ values. It is likely
that such a library already exists and just needs to be added to
Emacs. However, in addition to finding an existing library, it would of
course also have to be GPLv3 licensed in order to be added to Emacs

Another aspect of this feature request which hasn't yet been considered
is what to do with respect to exporting data. Will we also need some way
to define/set the TZ for exported documents? Are there issues to be
considered with respect to code tangling? 


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14  9:32     ` Tim Cross
@ 2023-01-14 11:08       ` Russell Adams
  2023-01-14 11:35         ` Ihor Radchenko
  2023-01-14 11:30       ` Ihor Radchenko
  2023-01-14 11:55       ` Max Nikulin
  2 siblings, 1 reply; 330+ messages in thread
From: Russell Adams @ 2023-01-14 11:08 UTC (permalink / raw)
  To: emacs-orgmode

On Sat, Jan 14, 2023 at 08:32:30PM +1100, Tim Cross wrote:
> If org was to add TZ capabilities to timestamps, the underlying format
> would have to be UTC. My previous post where I suggested there was two
> 'layers', the underlying storage layer (used for calculations like
> duration or comparison etc) and a presentation layer (what the human
> sees, which is often in whatever their local TZ is).

One of the key issues is that Org timestamps were supposed to be human
writable and readable.

Computer generated timestamps can easily be long and complex, and
potentially hidden under a presentation layer.

I have yet to see a proposal that really satisfies both use cases.

Writing incomplete timestamps as a human means timestamps in $TZ. Long
computer generated timestamps may prefer UTC or to include timezone
information (ie: ISO 8601 or RFC 3339).

Can't Org also ready diary formatted timestamps? Do those include
timezones? I know they include better repeat information. Maybe we can
build on that?

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com
                                    https://www.adamsinfoserv.com/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-13 12:51 ` Tim Cross
  2023-01-14  6:27   ` Daryl Manning
@ 2023-01-14 11:18   ` Ihor Radchenko
  2023-01-14 11:26     ` Daryl Manning
                       ` (2 more replies)
  1 sibling, 3 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-14 11:18 UTC (permalink / raw)
  To: Tim Cross; +Cc: Daryl Manning, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> I agree this would be a great feature to add. However, after having
> looked at it in some detail, I realise that not only is it not a trivial
> task, it is actually a very large and complex task and will require
> extensive work which will almost certainly result in breakage with
> regards to backwards compatibility.

Not really. Our timestamp format, in fact, provides sufficient
flexibility to add extra metadata to timestamps.

In anticipation to add time zones in future, I have added the following
to the Org timestamp spec (see
https://orgmode.org/worg/org-syntax.html#Timestamps):

DATE TIME REPEATER-OR-DELAY

TIME (optional)
An instance of the pattern H:MMREST where H represents a one to two digit number (and can start with 0), and M represents a single digit. REST can contain anything but \n or closing bracket.

Note that REST imply that almost arbitrary suffix can be in TIME without
braking the existing Org timestamp parsing code.

REST, among other things may be
https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC or a valid
value of TZ POSIX variable. Exact details can be discussed.

Note that TZ should be fully supported by `encode-time' (ZONE):

(SECOND MINUTE HOUR DAY MONTH YEAR IGNORED DST ZONE)

We do not need to worry about internal representation and conversions
and simply rely on Emacs.

> At the risk of over simplifying the matter, I would suggest the big
> challenge here is that there are two somewhat competing (and
> conflicting) use cases. On one hand, you want a high level abstraction
> which makes working with dates and times easy and clear. TO some extent,
> that is what we have now. On the other hand, we need something far more
> complex which is able to handle multiple time zones. This means being
> able to handle both base timezone offsets as well as offset adjustments
> for things like daylight savings time. There is a lot of hidden
> complexity here. You have to handle the fact that daylight saving
> chang-over dates/times are dynamic i.e. not necessarily the same every
> year. This adds the additional complexity of having to somehow track
> historical information regarding such changes, which isn't as readily
> accessible in a consistent manner on all platforms.

We do not care about the details as long as Emacs can handle this. As
long as the user supplies DST and ZONE somehow, we can rely on Emacs'
support and system TZ implementation.

> Then there is the other 'messy' stuff. For example, when calculating
> time ranges and number of days, hours/ minutes between two dates you
> need to remember to add/remove the hour if the range crosses over a
> daylight savings period. Similarly you need to ensure you make the
> correct adjustment when changing timezones (consider emacs on a laptop
> for someone who travels a lot between different time zones). Not only do
> you need to take into account the different timezone offset, you also
> need to look at the date and then adjust according to the timezone
> offset for the current timezone at the time of the timestamp rather than
> just considering the current time offset.  

Again, we don't need to worry about this. Once we use `encode-time',
operations on time should just work. This is what we do anyway in most
of Org code.

> I expect what is needed is an 'internal' UTC based representation which
> is used for all calculations and an 'interface' layer, which converts
> the UTC representation into the local display representation for
> consumption by humans.

This is what we already to via `encode-time' and `decode-time'.
Check out `org-time-string-to-time'.

> However, the real challenge here is that this is a very large piece of
> work and it needs someone who is prepared to take it on. I suspect until
> someone who needs to scratch this itch sufficiently comes along, this is
> a feature which will be unlikely to make it to the top of the todo
> list. There are simply far too many existing feature improvements and
> additions people will prefer to work on before taking on this
> one. Things are made more difficult because it isn't the sort of task
> which can be achieved with small increments over time. This is more
> likely to be something which needs to be developed in a feature branch,
> which once it reaches a sufficient level of completeness can be used and 
> verified working for a wide variety of environments before then working
> out how to fold it back into the core system and handle whatever change
> management will be necessary. 

Not as much as you describe. Not small work either though.
Most of the machinery is already in place, except some leftover pieces
from early Org days.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 11:18   ` Ihor Radchenko
@ 2023-01-14 11:26     ` Daryl Manning
  2023-01-14 11:42       ` Ihor Radchenko
  2023-01-14 13:03     ` Tim Cross
  2023-01-16  5:01     ` Tom Gillespie
  2 siblings, 1 reply; 330+ messages in thread
From: Daryl Manning @ 2023-01-14 11:26 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Tim Cross, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 5684 bytes --]

Hey Ihor,

Sorry, I had a little trouble understanding the way you have the syntax
written in that timestamps doc.

Can you give an example like below? What does it look like?
And say, with a recurring data like once a week and a warning of 5d early?

I believe /most/ people would be looking for something grokable like:
<2023-01-14 Sat 18:22 SGT> or say
<2023-01-14 Sat 18:22 +08>
(tho I imagine the second example would break repeats syntax though)
primarily useful in TODOs etc.

Daryl.









On Sat, Jan 14, 2023 at 6:18 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> Tim Cross <theophilusx@gmail.com> writes:
>
> > I agree this would be a great feature to add. However, after having
> > looked at it in some detail, I realise that not only is it not a trivial
> > task, it is actually a very large and complex task and will require
> > extensive work which will almost certainly result in breakage with
> > regards to backwards compatibility.
>
> Not really. Our timestamp format, in fact, provides sufficient
> flexibility to add extra metadata to timestamps.
>
> In anticipation to add time zones in future, I have added the following
> to the Org timestamp spec (see
> https://orgmode.org/worg/org-syntax.html#Timestamps):
>
> DATE TIME REPEATER-OR-DELAY
>
> TIME (optional)
> An instance of the pattern H:MMREST where H represents a one to two digit
> number (and can start with 0), and M represents a single digit. REST can
> contain anything but \n or closing bracket.
>
> Note that REST imply that almost arbitrary suffix can be in TIME without
> braking the existing Org timestamp parsing code.
>
> REST, among other things may be
> https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC or a valid
> value of TZ POSIX variable. Exact details can be discussed.
>
> Note that TZ should be fully supported by `encode-time' (ZONE):
>
> (SECOND MINUTE HOUR DAY MONTH YEAR IGNORED DST ZONE)
>
> We do not need to worry about internal representation and conversions
> and simply rely on Emacs.
>
> > At the risk of over simplifying the matter, I would suggest the big
> > challenge here is that there are two somewhat competing (and
> > conflicting) use cases. On one hand, you want a high level abstraction
> > which makes working with dates and times easy and clear. TO some extent,
> > that is what we have now. On the other hand, we need something far more
> > complex which is able to handle multiple time zones. This means being
> > able to handle both base timezone offsets as well as offset adjustments
> > for things like daylight savings time. There is a lot of hidden
> > complexity here. You have to handle the fact that daylight saving
> > chang-over dates/times are dynamic i.e. not necessarily the same every
> > year. This adds the additional complexity of having to somehow track
> > historical information regarding such changes, which isn't as readily
> > accessible in a consistent manner on all platforms.
>
> We do not care about the details as long as Emacs can handle this. As
> long as the user supplies DST and ZONE somehow, we can rely on Emacs'
> support and system TZ implementation.
>
> > Then there is the other 'messy' stuff. For example, when calculating
> > time ranges and number of days, hours/ minutes between two dates you
> > need to remember to add/remove the hour if the range crosses over a
> > daylight savings period. Similarly you need to ensure you make the
> > correct adjustment when changing timezones (consider emacs on a laptop
> > for someone who travels a lot between different time zones). Not only do
> > you need to take into account the different timezone offset, you also
> > need to look at the date and then adjust according to the timezone
> > offset for the current timezone at the time of the timestamp rather than
> > just considering the current time offset.
>
> Again, we don't need to worry about this. Once we use `encode-time',
> operations on time should just work. This is what we do anyway in most
> of Org code.
>
> > I expect what is needed is an 'internal' UTC based representation which
> > is used for all calculations and an 'interface' layer, which converts
> > the UTC representation into the local display representation for
> > consumption by humans.
>
> This is what we already to via `encode-time' and `decode-time'.
> Check out `org-time-string-to-time'.
>
> > However, the real challenge here is that this is a very large piece of
> > work and it needs someone who is prepared to take it on. I suspect until
> > someone who needs to scratch this itch sufficiently comes along, this is
> > a feature which will be unlikely to make it to the top of the todo
> > list. There are simply far too many existing feature improvements and
> > additions people will prefer to work on before taking on this
> > one. Things are made more difficult because it isn't the sort of task
> > which can be achieved with small increments over time. This is more
> > likely to be something which needs to be developed in a feature branch,
> > which once it reaches a sufficient level of completeness can be used and
> > verified working for a wide variety of environments before then working
> > out how to fold it back into the core system and handle whatever change
> > management will be necessary.
>
> Not as much as you describe. Not small work either though.
> Most of the machinery is already in place, except some leftover pieces
> from early Org days.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 7299 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14  9:32     ` Tim Cross
  2023-01-14 11:08       ` Russell Adams
@ 2023-01-14 11:30       ` Ihor Radchenko
  2023-01-14 14:09         ` Tim Cross
  2023-01-14 11:55       ` Max Nikulin
  2 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-14 11:30 UTC (permalink / raw)
  To: Tim Cross; +Cc: Max Nikulin, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> Daryl mentioned elsewhere in this thread that how hard this feature
> would be depends largely on the available libraries for elisp with
> respect to working with date/time values. Sadly, the available elisp
> libraries are inadequate in this area. While many of the functions can
> be called with an optional argument defining time zone information,
> there is no library which can retrieve this information in a consistent
> manner and which supports historical data lookup e.g. what were the DST
> transition dates for NSW Australia in 1970 (trick questions, NSW didn't
> adopt DST until 1971). The existing library functions are focused more
> on simpler time calculations where time zone information is less
> relevant i.e. running timers, timing command execution, comparing file
> modification times etc. Sometimes, it is easy to forget that while Elisp
> is powerful, it isn't really a general purpose programming language like
> C or Rust or even CL and Scheme. It is primarily a programming language
> focused  on a specific domain, the editor. While it has some great
> libraries  it also has  anumber of areas where it lacks the sort of
> sophistication we have grown to expect with more general purpose
> languages.

Emacs' own time zone support is relying on external libraries. AFAIU,
historical context should be handled no worse than in the OS.

More precisely, tzlookup from timefns.c relies on time.h and Windows
equivalents. All the heavy lifting is done by core OS libraries.

> A further complication is that accessing date and time related data is
> very system dependent and there is no high level library which abstracts
> this so that you  can easily get consistent results across all the
> platforms Emacs runs on. Even the underlying data type can vary greatly
> (i.e. some platforms use a 64 bit value while others only use a 32 bit one).

This is not the problem we need to worry about. We can use whatever
Emacs provides and rely on future improvements in Emacs where things are
deficient. We should not aim for 100% accurate time zone support. Just
good enough. It's not Org's job to implement the gory details of time
zone support.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 11:08       ` Russell Adams
@ 2023-01-14 11:35         ` Ihor Radchenko
  2023-01-14 12:00           ` Russell Adams
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-14 11:35 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode

Russell Adams <RLAdams@adamsinfoserv.com> writes:

> Can't Org also ready diary formatted timestamps?

We support diary sexps.

> Do those include timezones?

No, AFAIK. sexps may (they are just Elisp functions, anyway).

> I know they include better repeat information. Maybe we can
> build on that?

Is it really better? Apart from sexps, diaries support cron-like
repeaters, but more limited.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 11:26     ` Daryl Manning
@ 2023-01-14 11:42       ` Ihor Radchenko
  2023-01-15  5:11         ` Max Nikulin
  2023-01-20 10:57         ` Ihor Radchenko
  0 siblings, 2 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-14 11:42 UTC (permalink / raw)
  To: Daryl Manning; +Cc: Tim Cross, emacs-orgmode

Daryl Manning <daryl@wakatara.com> writes:

> Can you give an example like below? What does it look like?
> And say, with a recurring data like once a week and a warning of 5d early?
>
> I believe /most/ people would be looking for something grokable like:
> <2023-01-14 Sat 18:22 SGT> or say
> <2023-01-14 Sat 18:22 +08>
> (tho I imagine the second example would break repeats syntax though)
> primarily useful in TODOs etc.

For example,

<2023-01-14 Sat 18:22@Asia/Singapore>  (SGD and similar abbreviations are often ambiguous)
<2023-01-14 Sat 18:22+0800>
<2023-01-14 Sat 18:22+08>
<2023-01-14 Sat 18:22@+0800>
<2023-01-14 Sat 18:22@+08>

<2023-01-14 Sat 18:22@+08 +1w -5d>

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14  9:32     ` Tim Cross
  2023-01-14 11:08       ` Russell Adams
  2023-01-14 11:30       ` Ihor Radchenko
@ 2023-01-14 11:55       ` Max Nikulin
  2023-01-14 13:50         ` Tim Cross
  2 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-14 11:55 UTC (permalink / raw)
  To: emacs-orgmode

On 14/01/2023 16:32, Tim Cross wrote:
> 
> If org was to add TZ capabilities to timestamps, the underlying format
> would have to be UTC.
...
> can change based on various criteria, including political whims
> (e.g. Australia eastern DST transition date was changed in 2000 because
> Sydney hosted the Olympics that year).

Due to this particular reason storage format for significant fraction of 
future timestamps (but not always) must not be in UTC

2024-01-14 Sun 21:14:58 ACS (+0930, Australia/Darwin)

is not the same as

2024-01-14 Sun 11:45:58 UTC (+0000, Z)

despite currently it is.

Depending on use case the same particular fields of timestamp may be 
authoritative or derived for user convenience from other data.

UNIX timestamps in seconds in UTC timezone almost unavoidable will be 
used underneath, but operations like "start of next day" require 
non-trivial computations to find if time zone offset changes in between.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 11:35         ` Ihor Radchenko
@ 2023-01-14 12:00           ` Russell Adams
  2023-01-14 12:16             ` [FR] Allow end date and max repeat count for timestamps with repeaters (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Ihor Radchenko
  2023-01-14 12:19             ` [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Ihor Radchenko
  0 siblings, 2 replies; 330+ messages in thread
From: Russell Adams @ 2023-01-14 12:00 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

On Sat, Jan 14, 2023 at 11:35:00AM +0000, Ihor Radchenko wrote:
> Russell Adams <RLAdams@adamsinfoserv.com> writes:
>
> > Can't Org also ready diary formatted timestamps?
>
> We support diary sexps.
>
> > Do those include timezones?
>
> No, AFAIK. sexps may (they are just Elisp functions, anyway).
>
> > I know they include better repeat information. Maybe we can
> > build on that?
>
> Is it really better? Apart from sexps, diaries support cron-like
> repeaters, but more limited.

They have repeat with a end date or max iterations.


Doesn't Emacs Calc have timezone conversion functions natively?

>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>


------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com
                                    https://www.adamsinfoserv.com/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* [FR] Allow end date and max repeat count for timestamps with repeaters (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)
  2023-01-14 12:00           ` Russell Adams
@ 2023-01-14 12:16             ` Ihor Radchenko
  2023-01-15  1:09               ` Samuel Wales
  2023-01-14 12:19             ` [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Ihor Radchenko
  1 sibling, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-14 12:16 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode

Russell Adams <RLAdams@adamsinfoserv.com> writes:

>> > I know they include better repeat information. Maybe we can
>> > build on that?
>>
>> Is it really better? Apart from sexps, diaries support cron-like
>> repeaters, but more limited.
>
> They have repeat with a end date or max iterations.

Good point. These two features are also frequently requested by users.
However, I do not see why we cannot implement them within the current
Org timestamp syntax:

1. <2023-01-14 Sat +1w>--<2024-01-14 Sun>
   can be treated as a repeater with end date.

2. <2023-01-14 Sat +1w/5x>
   can be treated as a repeater with limited number of iterations

The above are backwards-compatible with Org timestamp syntax.

Supporting these cases will require:
1. Updating syntax spec
2. Changing `org-auto-repeat-maybe' to decrease +1w/5x to +1w/4x upon
   updating the timestamp and not repeating when the limit has been
   reached.
3. Updating org-agenda to not display timestamps beyond the limit.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 12:00           ` Russell Adams
  2023-01-14 12:16             ` [FR] Allow end date and max repeat count for timestamps with repeaters (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Ihor Radchenko
@ 2023-01-14 12:19             ` Ihor Radchenko
  2023-01-14 12:21               ` Russell Adams
  1 sibling, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-14 12:19 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode

Russell Adams <RLAdams@adamsinfoserv.com> writes:

> Doesn't Emacs Calc have timezone conversion functions natively?

Calc's time zone calculations are hard coded. We should rather rely on
OS library primitives. They have better chances to get updated as
politics changes in some countries.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 12:19             ` [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Ihor Radchenko
@ 2023-01-14 12:21               ` Russell Adams
  2023-01-14 12:31                 ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Russell Adams @ 2023-01-14 12:21 UTC (permalink / raw)
  To: emacs-orgmode

On Sat, Jan 14, 2023 at 12:19:17PM +0000, Ihor Radchenko wrote:
> Russell Adams <RLAdams@adamsinfoserv.com> writes:
>
> > Doesn't Emacs Calc have timezone conversion functions natively?
>
> Calc's time zone calculations are hard coded. We should rather rely on
> OS library primitives. They have better chances to get updated as
> politics changes in some countries.

I had no idea.

Wouldn't Emacs be updated eventually if timezones change? Doesn't it
use the tzdb?

I'd rather see Org depend on built in Emacs functions than OS.

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com
                                    https://www.adamsinfoserv.com/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 12:21               ` Russell Adams
@ 2023-01-14 12:31                 ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-14 12:31 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode

Russell Adams <RLAdams@adamsinfoserv.com> writes:

>> Calc's time zone calculations are hard coded. We should rather rely on
>> OS library primitives. They have better chances to get updated as
>> politics changes in some countries.
>
> I had no idea.
>
> Wouldn't Emacs be updated eventually if timezones change? Doesn't it
> use the tzdb?

Emacs uses time.h on Linux. If I understand correctly, time.h should use
tzdb or whatever is called in the particular GNU/Linux distribution.

> I'd rather see Org depend on built in Emacs functions than OS.

That's a question to Emacs developers. AFAIR, Emacs uses system
libraries for time zones because otherwise the maintenance would be
unbearable.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14  6:27   ` Daryl Manning
@ 2023-01-14 12:46     ` Jean Louis
  0 siblings, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-14 12:46 UTC (permalink / raw)
  To: Daryl Manning; +Cc: Tim Cross, emacs-orgmode

* Daryl Manning <daryl@wakatara.com> [2023-01-14 09:30]:
> To Jean Louis' point: using timestamps without timezones is a don't in much
> of computing these days and perhaps hearkens back to the simpler age emacs
> and org originated in.  =]  (kidding!).

I see it that way, yes. Isn't it so.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 11:18   ` Ihor Radchenko
  2023-01-14 11:26     ` Daryl Manning
@ 2023-01-14 13:03     ` Tim Cross
  2023-01-14 13:22       ` Ihor Radchenko
  2023-01-16  5:01     ` Tom Gillespie
  2 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-14 13:03 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Daryl Manning, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Tim Cross <theophilusx@gmail.com> writes:
>
>> I agree this would be a great feature to add. However, after having
>> looked at it in some detail, I realise that not only is it not a trivial
>> task, it is actually a very large and complex task and will require
>> extensive work which will almost certainly result in breakage with
>> regards to backwards compatibility.
>
> Not really. Our timestamp format, in fact, provides sufficient
> flexibility to add extra metadata to timestamps.
>
> In anticipation to add time zones in future, I have added the following
> to the Org timestamp spec (see
> https://orgmode.org/worg/org-syntax.html#Timestamps):
>
> DATE TIME REPEATER-OR-DELAY
>
> TIME (optional)
> An instance of the pattern H:MMREST where H represents a one to two digit number (and can
> start with 0), and M represents a single digit. REST can contain anything but \n or
> closing bracket.
>
> Note that REST imply that almost arbitrary suffix can be in TIME without
> braking the existing Org timestamp parsing code.
>
> REST, among other things may be
> https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC or a valid
> value of TZ POSIX variable. Exact details can be discussed.
>
> Note that TZ should be fully supported by `encode-time' (ZONE):
>
> (SECOND MINUTE HOUR DAY MONTH YEAR IGNORED DST ZONE)
>
> We do not need to worry about internal representation and conversions
> and simply rely on Emacs.
>
>> At the risk of over simplifying the matter, I would suggest the big
>> challenge here is that there are two somewhat competing (and
>> conflicting) use cases. On one hand, you want a high level abstraction
>> which makes working with dates and times easy and clear. TO some extent,
>> that is what we have now. On the other hand, we need something far more
>> complex which is able to handle multiple time zones. This means being
>> able to handle both base timezone offsets as well as offset adjustments
>> for things like daylight savings time. There is a lot of hidden
>> complexity here. You have to handle the fact that daylight saving
>> chang-over dates/times are dynamic i.e. not necessarily the same every
>> year. This adds the additional complexity of having to somehow track
>> historical information regarding such changes, which isn't as readily
>> accessible in a consistent manner on all platforms.
>
> We do not care about the details as long as Emacs can handle this. As
> long as the user supplies DST and ZONE somehow, we can rely on Emacs'
> support and system TZ implementation.
>
>> Then there is the other 'messy' stuff. For example, when calculating
>> time ranges and number of days, hours/ minutes between two dates you
>> need to remember to add/remove the hour if the range crosses over a
>> daylight savings period. Similarly you need to ensure you make the
>> correct adjustment when changing timezones (consider emacs on a laptop
>> for someone who travels a lot between different time zones). Not only do
>> you need to take into account the different timezone offset, you also
>> need to look at the date and then adjust according to the timezone
>> offset for the current timezone at the time of the timestamp rather than
>> just considering the current time offset.  
>
> Again, we don't need to worry about this. Once we use `encode-time',
> operations on time should just work. This is what we do anyway in most
> of Org code.
>
>> I expect what is needed is an 'internal' UTC based representation which
>> is used for all calculations and an 'interface' layer, which converts
>> the UTC representation into the local display representation for
>> consumption by humans.
>
> This is what we already to via `encode-time' and `decode-time'.
> Check out `org-time-string-to-time'.
>
>> However, the real challenge here is that this is a very large piece of
>> work and it needs someone who is prepared to take it on. I suspect until
>> someone who needs to scratch this itch sufficiently comes along, this is
>> a feature which will be unlikely to make it to the top of the todo
>> list. There are simply far too many existing feature improvements and
>> additions people will prefer to work on before taking on this
>> one. Things are made more difficult because it isn't the sort of task
>> which can be achieved with small increments over time. This is more
>> likely to be something which needs to be developed in a feature branch,
>> which once it reaches a sufficient level of completeness can be used and 
>> verified working for a wide variety of environments before then working
>> out how to fold it back into the core system and handle whatever change
>> management will be necessary. 
>
> Not as much as you describe. Not small work either though.
> Most of the machinery is already in place, except some leftover pieces
> from early Org days.

Hi Ihor,

I think you may only be looking at the representation and not
considering the actual mechanics which will be required to make this all
work.

Consider for example an agenda file where the TODO items have been added
while I am here in Australia (currently +11:00 w/ DST). Tomorrow I fly
to Europe where I will be working for the next 6 weeks. I need all my
TODOs with active timestamps to be updated to Berlin's TZ. How does this
work?

The representation of the timestamps is the easy part. It is the
management, display, calculations, etc where the complications
arise. From looking at the supported time related functions in Emacs,
while most of the key ones do have support for passing in time zone
data, there seems little (if any) code to support the lookup and
retrieval of time zone data - in particular, ability to lookup time zone
data for a specific date, not just a location.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14  7:12   ` Max Nikulin
  2023-01-14  9:32     ` Tim Cross
@ 2023-01-14 13:08     ` Jean Louis
  2023-01-14 16:58       ` Max Nikulin
  1 sibling, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-14 13:08 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

* Max Nikulin <manikulin@gmail.com> [2023-01-14 10:14]:
> Let's assume <2023-01-15 Sun 09:00 +1>
> 
> It may be suitable for timestamps in the past, but future is more tricky.
> There is no problem if you are going to watch Lunar eclipse. However if your
> plan is to attend a local event there is a chance that you will arrive at
> wrong time. Sometimes offset of timezones is changed and it may happen
> between the moment when you added a scheduled time and the moment of the
> event.

Can't follow you.

with "+1" I would say it is time zone.

Basic point is that users shall learn to express themselves by using
time zone.

That may be set as global property, which could be enough for Org file
to be mobile, that Org file may be conclusively understood in any
other time zone of the world when some specific thing happened.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 13:03     ` Tim Cross
@ 2023-01-14 13:22       ` Ihor Radchenko
  2023-01-15 19:10         ` Jean Louis
  2023-01-15 20:43         ` Jean Louis
  0 siblings, 2 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-14 13:22 UTC (permalink / raw)
  To: Tim Cross; +Cc: Daryl Manning, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> Consider for example an agenda file where the TODO items have been added
> while I am here in Australia (currently +11:00 w/ DST). Tomorrow I fly
> to Europe where I will be working for the next 6 weeks. I need all my
> TODOs with active timestamps to be updated to Berlin's TZ. How does this
> work?

I am not sure what is the problem.
The timestamps that should stay in local time will be automatically
updated as your system TZ is updated.
The timestamps that should be tied to specific time zone will specify
that required time zone and will thus remain functional.

> The representation of the timestamps is the easy part. It is the
> management, display, calculations, etc where the complications
> arise. From looking at the supported time related functions in Emacs,
> while most of the key ones do have support for passing in time zone
> data, there seems little (if any) code to support the lookup and
> retrieval of time zone data - in particular, ability to lookup time zone
> data for a specific date, not just a location.

But why do we need any time zone data? All we need to converting from
and to internal Emacs' time representation supplying the correct time
zone to it.

Or are you trying to get an agenda where you plan to change the time
zone in the middle? That's indeed a tricky problem, but it is even
solved by any existing calendar app? Do we need to solve it?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 11:55       ` Max Nikulin
@ 2023-01-14 13:50         ` Tim Cross
  2023-01-14 16:50           ` Max Nikulin
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-14 13:50 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 14/01/2023 16:32, Tim Cross wrote:
>> If org was to add TZ capabilities to timestamps, the underlying format
>> would have to be UTC.
> ...
>> can change based on various criteria, including political whims
>> (e.g. Australia eastern DST transition date was changed in 2000 because
>> Sydney hosted the Olympics that year).
>
> Due to this particular reason storage format for significant fraction of future timestamps
> (but not always) must not be in UTC
>
> 2024-01-14 Sun 21:14:58 ACS (+0930, Australia/Darwin)
>
> is not the same as
>
> 2024-01-14 Sun 11:45:58 UTC (+0000, Z)
>
> despite currently it is.
>

I"m sorry, but I don't follow. The UTC time is the only time whihc is
not affected by daylight savings transitions, so is the only stable
metric. All the others are relative to that time but can change based on
things like changes in DST transition dates/times. When DST transitions
occur, time is lost/gained wrt the local time, but real time and UTC
time do not change. So when DST starts here at 2am on the llth it is 5pm
on the 10th UTC. At 2am locally, we jump to 3am, losing an hour, but the
UTC time is still 5pm. The meeting I had scheduled for 10am with friends
form the US was at 0:00 UTC. It is now at 11am local time, but still at
0:00 UTC, however, I will likely fall asleep in it because instead of my
normal 7 hours sleep, I only got six despite going to be and getting up
at the same time.  

> Depending on use case the same particular fields of timestamp may be authoritative or
> derived for user convenience from other data.
>
> UNIX timestamps in seconds in UTC timezone almost unavoidable will be used underneath, but
> operations like "start of next day" require non-trivial computations to find if time zone
> offset changes in between.

Yes, but if the underlying representation is UTC, then all you have to
do is apply local TZ data to get the local time. THis is how postgres
works. You just hav eto ensure the TZ data you get is the TZ data for
that date in that locale. 


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 11:30       ` Ihor Radchenko
@ 2023-01-14 14:09         ` Tim Cross
  2023-01-14 14:38           ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-14 14:09 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Max Nikulin, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Tim Cross <theophilusx@gmail.com> writes:
>
>> Daryl mentioned elsewhere in this thread that how hard this feature
>> would be depends largely on the available libraries for elisp with
>> respect to working with date/time values. Sadly, the available elisp
>> libraries are inadequate in this area. While many of the functions can
>> be called with an optional argument defining time zone information,
>> there is no library which can retrieve this information in a consistent
>> manner and which supports historical data lookup e.g. what were the DST
>> transition dates for NSW Australia in 1970 (trick questions, NSW didn't
>> adopt DST until 1971). The existing library functions are focused more
>> on simpler time calculations where time zone information is less
>> relevant i.e. running timers, timing command execution, comparing file
>> modification times etc. Sometimes, it is easy to forget that while Elisp
>> is powerful, it isn't really a general purpose programming language like
>> C or Rust or even CL and Scheme. It is primarily a programming language
>> focused  on a specific domain, the editor. While it has some great
>> libraries  it also has  anumber of areas where it lacks the sort of
>> sophistication we have grown to expect with more general purpose
>> languages.
>
> Emacs' own time zone support is relying on external libraries. AFAIU,
> historical context should be handled no worse than in the OS.
>
> More precisely, tzlookup from timefns.c relies on time.h and Windows
> equivalents. All the heavy lifting is done by core OS libraries.
>
>> A further complication is that accessing date and time related data is
>> very system dependent and there is no high level library which abstracts
>> this so that you  can easily get consistent results across all the
>> platforms Emacs runs on. Even the underlying data type can vary greatly
>> (i.e. some platforms use a 64 bit value while others only use a 32 bit one).
>
> This is not the problem we need to worry about. We can use whatever
> Emacs provides and rely on future improvements in Emacs where things are
> deficient. We should not aim for 100% accurate time zone support. Just
> good enough. It's not Org's job to implement the gory details of time
> zone support.

I guess we will have to disagree here. If org is going to claim to
support time zones, then 100% accurate is IMO essential. As it stands
now, we don't claim TZ support and time calculations are correct on the
basis they are all done relative to current locale. However, once you
add TZ information, if you don't apply it consistently and correctly,
that means the values can no longer be relied upon.

Or to put it in another way - currently, it is well understood where org
timestamps fall down. However, once you add TZ and provide the
expectation TZ data will be respected correctly, all bets are off.

Anyway, I've made my point and will leave it alone now. Ironically, time
will tell us who is right and who isn't.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 14:09         ` Tim Cross
@ 2023-01-14 14:38           ` Ihor Radchenko
  2023-01-14 14:48             ` tomas
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-14 14:38 UTC (permalink / raw)
  To: Tim Cross; +Cc: Max Nikulin, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

>> This is not the problem we need to worry about. We can use whatever
>> Emacs provides and rely on future improvements in Emacs where things are
>> deficient. We should not aim for 100% accurate time zone support. Just
>> good enough. It's not Org's job to implement the gory details of time
>> zone support.
>
> I guess we will have to disagree here. If org is going to claim to
> support time zones, then 100% accurate is IMO essential. As it stands
> now, we don't claim TZ support and time calculations are correct on the
> basis they are all done relative to current locale. However, once you
> add TZ information, if you don't apply it consistently and correctly,
> that means the values can no longer be relied upon.
>
> Or to put it in another way - currently, it is well understood where org
> timestamps fall down. However, once you add TZ and provide the
> expectation TZ data will be respected correctly, all bets are off.

I think I need to clarify.
Emacs currently relies on glibc time zone support on Linux.
I am not sure if glibc is 100% accurate, but it should be good enough.
At least, there is no way we can do better ourselves.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 14:38           ` Ihor Radchenko
@ 2023-01-14 14:48             ` tomas
  2023-01-14 15:05               ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: tomas @ 2023-01-14 14:48 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

On Sat, Jan 14, 2023 at 02:38:05PM +0000, Ihor Radchenko wrote:

[...]

> > Or to put it in another way - currently, it is well understood where org
> > timestamps fall down. However, once you add TZ and provide the
> > expectation TZ data will be respected correctly, all bets are off.
> 
> I think I need to clarify.
> Emacs currently relies on glibc time zone support on Linux.
> I am not sure if glibc is 100% accurate, but it should be good enough.
> At least, there is no way we can do better ourselves.

TBH, this is the only way which makes sense. The OS keeps the Olson
database up to date and all applications rely on that. Anything else
would be madness.

Now there's still enough work for the applications to do: presentation,
parsing, disambiguation, if necessary asking the user for help. Someone
mentioned PostgreSQL -- this is a nice example of what can be done beyond
the (comparatively!) boring details of time zone management :-)

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 14:48             ` tomas
@ 2023-01-14 15:05               ` Ihor Radchenko
  2023-01-14 16:50                 ` tomas
                                   ` (2 more replies)
  0 siblings, 3 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-14 15:05 UTC (permalink / raw)
  To: tomas; +Cc: emacs-orgmode

<tomas@tuxteam.de> writes:

> Now there's still enough work for the applications to do: presentation,
> parsing, disambiguation, if necessary asking the user for help. Someone
> mentioned PostgreSQL -- this is a nice example of what can be done beyond
> the (comparatively!) boring details of time zone management :-)

Do I understand correctly that PostgreSQL insists on using timestamps
with time zone info in favour or ordinary timestamps? Exactly to avoid
issues with the same timestamp pointing to a different real time from
epoch depending on the current OS time zone setting?

Thinking more about this, I can see how it can be important for
clocking, and similar auto-recorded information. Users may be surprised
to record clocking on some task yesterday just to find the clocking data
in future upon travelling from Singapore to San Fran.

So, when implementing time zones, we may need to take care about adding
the time zone info when auto-inserting timestamps.

In addition, we may provide some mechanism to set the time zone for:
1. Individual files
2. For all files, including possible time zone transitions over time.

What I mean by (2) is when the user travels from, say, Australia to USA,
it could be possible to say: Use Australia/Seattle up to certain time
and then use USA/Austin.

However, the above considerations are just nice-to-haves and should not
be a blocker to a more generic time zone support in Org. Having an
ability to specify time zones manually will already cater needs for a
number of users.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 15:05               ` Ihor Radchenko
@ 2023-01-14 16:50                 ` tomas
  2023-01-14 17:06                   ` Ihor Radchenko
  2023-01-14 20:56                   ` Tim Cross
  2023-01-15  4:37                 ` Max Nikulin
  2023-01-15  5:03                 ` Max Nikulin
  2 siblings, 2 replies; 330+ messages in thread
From: tomas @ 2023-01-14 16:50 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2242 bytes --]

On Sat, Jan 14, 2023 at 03:05:22PM +0000, Ihor Radchenko wrote:
> <tomas@tuxteam.de> writes:
> 
> > Now there's still enough work for the applications to do: presentation,
> > parsing, disambiguation, if necessary asking the user for help. Someone
> > mentioned PostgreSQL -- this is a nice example of what can be done beyond
> > the (comparatively!) boring details of time zone management :-)
> 
> Do I understand correctly that PostgreSQL insists on using timestamps
> with time zone info in favour or ordinary timestamps? Exactly to avoid
> issues with the same timestamp pointing to a different real time from
> epoch depending on the current OS time zone setting?

It doesn't insist: it offers both data types, but the docs are very clear
on what they prefer.

> Thinking more about this, I can see how it can be important for
> clocking, and similar auto-recorded information. Users may be surprised
> to record clocking on some task yesterday just to find the clocking data
> in future upon travelling from Singapore to San Fran.
> 
> So, when implementing time zones, we may need to take care about adding
> the time zone info when auto-inserting timestamps.
> 
> In addition, we may provide some mechanism to set the time zone for:
> 1. Individual files
> 2. For all files, including possible time zone transitions over time.
> 
> What I mean by (2) is when the user travels from, say, Australia to USA,
> it could be possible to say: Use Australia/Seattle up to certain time
> and then use USA/Austin.
> 
> However, the above considerations are just nice-to-haves and should not
> be a blocker to a more generic time zone support in Org. Having an
> ability to specify time zones manually will already cater needs for a
> number of users.

Definitely. But the time stamp (with time zone) in itself doesn't
carry enough context to actually decide that. It's even not that
easy to wrap one's head around dates that "travel" (the easiest
example would be perhaps: "9:00 show up at work" -- when DST takes
effect, it's still 9:00 whatever the local time is). When you
have appointments with people in totally diverse time zones, perhaps
dates tend to be more fixed wrt UTC.

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 13:50         ` Tim Cross
@ 2023-01-14 16:50           ` Max Nikulin
  2023-01-14 20:30             ` Tim Cross
  0 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-14 16:50 UTC (permalink / raw)
  To: emacs-orgmode

On 14/01/2023 20:50, Tim Cross wrote:
> 
> I"m sorry, but I don't follow. The UTC time is the only time whihc is
> not affected by daylight savings transitions, so is the only stable
> metric. All the others are relative to that time but can change based on
> things like changes in DST transition dates/times. When DST transitions
> occur, time is lost/gained wrt the local time, but real time and UTC
> time do not change. So when DST starts here at 2am on the llth it is 5pm
> on the 10th UTC. At 2am locally, we jump to 3am, losing an hour, but the
> UTC time is still 5pm. The meeting I had scheduled for 10am with friends
> form the US was at 0:00 UTC. It is now at 11am local time, but still at
> 0:00 UTC, however, I will likely fall asleep in it because instead of my
> normal 7 hours sleep, I only got six despite going to be and getting up
> at the same time.

Future events may be affected by changes in timezones happened after 
scheduling them. UTC timestamps becomes incorrect in such cases.

Let's assume that a company from Sydney has a weekly meeting on Mondays 
at 15:00 *local* time. Their standard time offset is +10:00

TZ="Australia/Sydney" date --date '2023-07-15 15:00' '+%F %a %T %Z %z'
2023-07-15 Sat 15:00:00 AEST +1000

They decided to invite a person from Singapore (no DST) to join the 
meeting online next year on 2024-01-15 during the period of summer 
(daylight saving) time (+11:00 offset) in Australia:

TZ="Australia/Sydney" date --date '2024-01-15 15:00' '+%F %a %T %Z %z'
2024-01-15 Mon 15:00:00 AEDT +1100

The person in Singapore should schedule the event at

LANG=C TZ=Asia/Singapore date --date 'TZ="Australia/Sydney" 2024-01-15 
15:00' '+%F %a %T %Z %z'
2024-01-15 Mon 12:00:00 +08 +0800

the same moment as UTC timestamp

date --utc --date 'TZ="Australia/Sydney" 2024-01-15 15:00' '+%F %a %T %Z %z'
2024-01-15 Mon 04:00:00 UTC +0000

If Australia were decided to cancel daylight saving time transition then 
for the Singapore partner the meeting would be shifted by 1 hour to

LANG=C TZ=Asia/Singapore date --date '2024-01-15 15:00 +1000' '+%F %a %T 
%Z %z'
2024-01-15 Mon 13:00:00 +08 +0800

LANG=C date --utc --date '2024-01-15 15:00 +1000' '+%F %a %T %Z %z'
2024-01-15 Mon 05:00:00 UTC +0000

If the guest from Singapore or some guy from Australia decided to store 
the appointment in UTC, not as local time, they would expect beginning 
of the meeting at 14:00 (Sydney time) instead of 15:00.

The primary data for this event is

     2024-01-15 15:00 Australia/Sydney

everything else is derived accordingly to current state of timezone 
database and should be recalculated in the case of its change:

- AEDT +1100
- 2024-01-15 Mon 04:00:00 UTC +0000
- 2024-01-15 Mon 12:00:00 +08 +0800 Asia/Singapore

So future events bound to local time must be stored as local time and 
the corresponding local timezone. UTC must be used for global events 
(e.g. an eclipse) or if the negotiation is to fix event time in UTC. UTC 
is not a silver bullet for time computations, it should be used consciously.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 13:08     ` Jean Louis
@ 2023-01-14 16:58       ` Max Nikulin
  2023-01-14 19:43         ` Tim Cross
  2023-01-15 19:12         ` Jean Louis
  0 siblings, 2 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-14 16:58 UTC (permalink / raw)
  To: emacs-orgmode

On 14/01/2023 20:08, Jean Louis wrote:
> * Max Nikulin [2023-01-14 10:14]:
>> Let's assume <2023-01-15 Sun 09:00 +1>
>>
>> It may be suitable for timestamps in the past, but future is more tricky.
>> There is no problem if you are going to watch Lunar eclipse. However if your
>> plan is to attend a local event there is a chance that you will arrive at
>> wrong time. Sometimes offset of timezones is changed and it may happen
>> between the moment when you added a scheduled time and the moment of the
>> event.
> 
> Can't follow you.
> 
> with "+1" I would say it is time zone.
> 
> Basic point is that users shall learn to express themselves by using
> time zone.

"+1" is not a timezone, it is current offset shared by several 
timezones. You can not assure that time offset at a particular location 
would not change due to new administrative rules.

E.g. Europe/Berlin is a timezone, but, strictly speaking, is still 
underspecified. Sometimes timezones are split into smaller parts.




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 16:50                 ` tomas
@ 2023-01-14 17:06                   ` Ihor Radchenko
  2023-01-14 17:13                     ` tomas
                                       ` (2 more replies)
  2023-01-14 20:56                   ` Tim Cross
  1 sibling, 3 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-14 17:06 UTC (permalink / raw)
  To: tomas; +Cc: emacs-orgmode

tomas@tuxteam.de writes:

>> ... Having an
>> ability to specify time zones manually will already cater needs for a
>> number of users.
>
> Definitely. But the time stamp (with time zone) in itself doesn't
> carry enough context to actually decide that. It's even not that
> easy to wrap one's head around dates that "travel" (the easiest
> example would be perhaps: "9:00 show up at work" -- when DST takes
> effect, it's still 9:00 whatever the local time is).

This is basically what we have now - conform to "current" system time
zone. We are not going to remove this timestamp style. Just add an
ability to explicitly specify the timestamps if needed.

> When you have appointments with people in totally diverse time zones,
> perhaps dates tend to be more fixed wrt UTC.

AFAIK, people don't usually bother. As long as you can map from specific
time zone (applying the currently active summer clock time changes) to
something like seconds from epoch, you can always calculate back to you
preferred time zone. Look at https://www.emacswiki.org/emacs/Usergroups.
They say, for example, "Europe/Berlin", which may be either CET or CEST.

In any case, selection of time zone for user timestamps is not something
we need to worry about in Org code. Users are to decide. Org might
assist, but I do not see anything meaningful we can do to help with DST.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 17:06                   ` Ihor Radchenko
@ 2023-01-14 17:13                     ` tomas
  2023-01-15 19:54                       ` Jean Louis
  2023-01-14 21:52                     ` Tim Cross
  2023-01-15 19:52                     ` Jean Louis
  2 siblings, 1 reply; 330+ messages in thread
From: tomas @ 2023-01-14 17:13 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1710 bytes --]

On Sat, Jan 14, 2023 at 05:06:31PM +0000, Ihor Radchenko wrote:
> tomas@tuxteam.de writes:
> 
> >> ... Having an
> >> ability to specify time zones manually will already cater needs for a
> >> number of users.
> >
> > Definitely. But the time stamp (with time zone) in itself doesn't
> > carry enough context to actually decide that [...]

> This is basically what we have now - conform to "current" system time
> zone. We are not going to remove this timestamp style. Just add an
> ability to explicitly specify the timestamps if needed.

IMO that totally makes sense. Most people just use time naively and
aren't around at half-past-three in the night when things happen :)

> > When you have appointments with people in totally diverse time zones,
> > perhaps dates tend to be more fixed wrt UTC.
> 
> AFAIK, people don't usually bother. As long as you can map from specific
> time zone (applying the currently active summer clock time changes) to
> something like seconds from epoch, you can always calculate back to you
> preferred time zone. Look at https://www.emacswiki.org/emacs/Usergroups.
> They say, for example, "Europe/Berlin", which may be either CET or CEST.
> 
> In any case, selection of time zone for user timestamps is not something
> we need to worry about in Org code. Users are to decide. Org might
> assist, but I do not see anything meaningful we can do to help with DST.

What I can imagine being useful (besides allowing timestamps to carry
that extra info) is the possibility to set defaults, perhaps at the
file (even, who knows, at the heading) level. A special attribute
seems pretty adequate, if I'm not missing some monster.

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 16:58       ` Max Nikulin
@ 2023-01-14 19:43         ` Tim Cross
  2023-01-15  6:37           ` tomas
                             ` (2 more replies)
  2023-01-15 19:12         ` Jean Louis
  1 sibling, 3 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-14 19:43 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 14/01/2023 20:08, Jean Louis wrote:
>> * Max Nikulin [2023-01-14 10:14]:
>>> Let's assume <2023-01-15 Sun 09:00 +1>
>>>
>>> It may be suitable for timestamps in the past, but future is more tricky.
>>> There is no problem if you are going to watch Lunar eclipse. However if your
>>> plan is to attend a local event there is a chance that you will arrive at
>>> wrong time. Sometimes offset of timezones is changed and it may happen
>>> between the moment when you added a scheduled time and the moment of the
>>> event.
>> Can't follow you.
>> with "+1" I would say it is time zone.
>> Basic point is that users shall learn to express themselves by using
>> time zone.
>
> "+1" is not a timezone, it is current offset shared by several timezones. You can not
> assure that time offset at a particular location would not change due to new
> administrative rules.
>
> E.g. Europe/Berlin is a timezone, but, strictly speaking, is still
> underspecified. Sometimes timezones are split into smaller parts.

Yes, this is a problem. We really want a symbolic TZ
specification and we would need 'smarts' i the timestamp generation code
that is able to handle potential offset changes due to daylight savings
transition etc. Even then, the transition time can change between when
the timestamp is set for and when it actually occurs.

Unfortunately, the common abbreviated forms like EST, AEST etc are
inconsistent here. Some places will have a standard and a daylight
savings type i.e. AEST and AEDT, while others will have just AEST. TO
make it worse, two locations with the same time zone offset my use
different versions i.e. Australia/Melbourn is AEST (+10/+11) and
Australia/Sydney is AEST (+10) and AEDT (+11) and Australia/Brisbane is
just AEST (+10). If everywhere which has daylight savings ensured they
used a different abbreviation for daylight saving and non-daylight
saving times, life would be easier, but they don't). Then of course
there are many countries which don't have a symbolic letter abbreviation
i.e. just have e.g -05 as their abbreviated TZ name.

It is this and other related reasons why just relying on Emacs' internal
API for times and dates is not sufficient. The abbreviated times have
ambiguity and the full timezone specification is cumbersome and
ugly. Even worse is that issue won't be shown up as failures - you will
just silently get wrong results.  

If on the other hand all the timestamps were in UTC, you avoid lots of
these issues. However, you would then also require a 'view'
layer/overlay which would take the UTC time, apply whatever the local TZ
is and show that result as the timestamp. THis would avoid things being
out by an hour due to daylight savings transitions and would mean the
user would see timestamps relative to whatever their local time zone is,
regardless of changes in location which has also changed time zones.

The problem with this approach is that now you have lost the 'plain
text' nature of org files. When editing the value, the user would need
to remember the value stored in their org file is UTC, not local
time. Many exporters would also need to be updated to handle conversion
to local time as well.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 16:50           ` Max Nikulin
@ 2023-01-14 20:30             ` Tim Cross
  2023-01-15  4:00               ` Max Nikulin
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-14 20:30 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 14/01/2023 20:50, Tim Cross wrote:
>> I"m sorry, but I don't follow. The UTC time is the only time whihc is
>> not affected by daylight savings transitions, so is the only stable
>> metric. All the others are relative to that time but can change based on
>> things like changes in DST transition dates/times. When DST transitions
>> occur, time is lost/gained wrt the local time, but real time and UTC
>> time do not change. So when DST starts here at 2am on the llth it is 5pm
>> on the 10th UTC. At 2am locally, we jump to 3am, losing an hour, but the
>> UTC time is still 5pm. The meeting I had scheduled for 10am with friends
>> form the US was at 0:00 UTC. It is now at 11am local time, but still at
>> 0:00 UTC, however, I will likely fall asleep in it because instead of my
>> normal 7 hours sleep, I only got six despite going to be and getting up
>> at the same time.
>
> Future events may be affected by changes in timezones happened after scheduling them. UTC
> timestamps becomes incorrect in such cases.
>
> Let's assume that a company from Sydney has a weekly meeting on Mondays at 15:00 *local*
> time. Their standard time offset is +10:00
>
> TZ="Australia/Sydney" date --date '2023-07-15 15:00' '+%F %a %T %Z %z'
> 2023-07-15 Sat 15:00:00 AEST +1000
>
> They decided to invite a person from Singapore (no DST) to join the meeting online next
> year on 2024-01-15 during the period of summer (daylight saving) time (+11:00 offset) in
> Australia:
>
> TZ="Australia/Sydney" date --date '2024-01-15 15:00' '+%F %a %T %Z %z'
> 2024-01-15 Mon 15:00:00 AEDT +1100
>
> The person in Singapore should schedule the event at
>
> LANG=C TZ=Asia/Singapore date --date 'TZ="Australia/Sydney" 2024-01-15 15:00' '+%F %a %T
> %Z %z'
> 2024-01-15 Mon 12:00:00 +08 +0800
>
> the same moment as UTC timestamp
>
> date --utc --date 'TZ="Australia/Sydney" 2024-01-15 15:00' '+%F %a %T %Z %z'
> 2024-01-15 Mon 04:00:00 UTC +0000
>
> If Australia were decided to cancel daylight saving time transition then for the Singapore
> partner the meeting would be shifted by 1 hour to
>
> LANG=C TZ=Asia/Singapore date --date '2024-01-15 15:00 +1000' '+%F %a %T %Z %z'
> 2024-01-15 Mon 13:00:00 +08 +0800
>
> LANG=C date --utc --date '2024-01-15 15:00 +1000' '+%F %a %T %Z %z'
> 2024-01-15 Mon 05:00:00 UTC +0000
>
> If the guest from Singapore or some guy from Australia decided to store the appointment in
> UTC, not as local time, they would expect beginning of the meeting at 14:00 (Sydney time)
> instead of 15:00.
>
> The primary data for this event is
>
>     2024-01-15 15:00 Australia/Sydney
>
> everything else is derived accordingly to current state of timezone database and should be
> recalculated in the case of its change:
>
> - AEDT +1100
> - 2024-01-15 Mon 04:00:00 UTC +0000
> - 2024-01-15 Mon 12:00:00 +08 +0800 Asia/Singapore
>
> So future events bound to local time must be stored as local time and the corresponding
> local timezone. UTC must be used for global events (e.g. an eclipse) or if the negotiation
> is to fix event time in UTC. UTC is not a silver bullet for time computations, it should
> be used consciously.

OK, I see what your arguing now. However, I disagree on the semantics
here. Really you have the exact same issue in both use cases. Only the
way it is handled is different. For example, I actually do have a
fortnightly meeting with people in the US and my meeting time changes
due to daylight savings transition. The UTC time stays the same, but the
meeting time for me changes twice per year (moving forward/backward an
hour). Likewise, it changes for most of the other people in the meeting
who are in various timzones except for one participant in Brisbane where
they don't have daylight savings time. His meeting time is constant all
year round.

With your semantics, the person in Singapore is the one who has to keep
changing the meeting time while for the Ausies in Sydney, it stays at
15:00 regardless. Worse yet, the Singapore participant has to chnage 4
times per year - when Singapore transitions and when Sydney does.

On the other hand, the downside with my approach is that when local
daylgiht savings transition occurs, all meeting times change, including
those with only local participants, which isn't great either. Again,
this is just some of the issues I'm concerned people are glossing over
when they say it isn't too hard to add TZ support and that we can
leverage off the built-in TZ facilities of Emacs and the OS. The
underlying semantics and model is far mor complex and getting a workable
and user friendly solution which maintains the utility of the existing
timestamps is complicated and hard. The fact you can only really rely on
full timezone names e.g. Australia/Sydney and not abbreviations like
AEST makes it even worse as we run the risk of loosing the compact
format. 


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 16:50                 ` tomas
  2023-01-14 17:06                   ` Ihor Radchenko
@ 2023-01-14 20:56                   ` Tim Cross
  2023-01-15 20:24                     ` Jean Louis
  1 sibling, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-14 20:56 UTC (permalink / raw)
  To: tomas; +Cc: Ihor Radchenko, emacs-orgmode

tomas@tuxteam.de writes:

> [[PGP Signed Part:Undecided]]
> On Sat, Jan 14, 2023 at 03:05:22PM +0000, Ihor Radchenko wrote:
>> <tomas@tuxteam.de> writes:
>> 
>> > Now there's still enough work for the applications to do: presentation,
>> > parsing, disambiguation, if necessary asking the user for help. Someone
>> > mentioned PostgreSQL -- this is a nice example of what can be done beyond
>> > the (comparatively!) boring details of time zone management :-)
>> 
>> Do I understand correctly that PostgreSQL insists on using timestamps
>> with time zone info in favour or ordinary timestamps? Exactly to avoid
>> issues with the same timestamp pointing to a different real time from
>> epoch depending on the current OS time zone setting?
>
> It doesn't insist: it offers both data types, but the docs are very clear
> on what they prefer.
>

The internal representation of timestamps used by Postgres is ALWAYS
UTC, regardless of whether the field was defined as timestamp or
timestamp with timezone. The only real difference is that if the field
is defined as just timestamp, postgres assumes the data being entered is
in local time and will adjust using the local timezone offset. It will
ignore any tz information in the input. If the field is defined as
timestamp with time zone, it will use the offset defined by the timezone
in the input to determine the UTGC value. When displaying a timestamp,
postgres always uses the local time zone unless you request a different
timezone using the 'at time zone' construct. 

>> Thinking more about this, I can see how it can be important for
>> clocking, and similar auto-recorded information. Users may be surprised
>> to record clocking on some task yesterday just to find the clocking data
>> in future upon travelling from Singapore to San Fran.
>> 
>> So, when implementing time zones, we may need to take care about adding
>> the time zone info when auto-inserting timestamps.
>> 
>> In addition, we may provide some mechanism to set the time zone for:
>> 1. Individual files
>> 2. For all files, including possible time zone transitions over time.
>> 
>> What I mean by (2) is when the user travels from, say, Australia to USA,
>> it could be possible to say: Use Australia/Seattle up to certain time
>> and then use USA/Austin.
>> 
>> However, the above considerations are just nice-to-haves and should not
>> be a blocker to a more generic time zone support in Org. Having an
>> ability to specify time zones manually will already cater needs for a
>> number of users.
>
> Definitely. But the time stamp (with time zone) in itself doesn't
> carry enough context to actually decide that. It's even not that
> easy to wrap one's head around dates that "travel" (the easiest
> example would be perhaps: "9:00 show up at work" -- when DST takes
> effect, it's still 9:00 whatever the local time is). When you
> have appointments with people in totally diverse time zones, perhaps
> dates tend to be more fixed wrt UTC.
>

One thing to keep in mind is that the abbreviated time zone names are
really just abbreviations for time offsets. So AEST is the same as
+1000. However, full timezone names represent complete timezone rules
i.e. Australia/Sydney is not just an offset value, it can tell us (via
the tz database) when daylight savings transitions occur (both for now
and in the past). The abbreviated names lack this information and can
also be ambiguous because some countries use the same abbreviation for
inside and outside daylight savings periods.  

This means that if we were to store timestamps in org files and use the
abbreviated tz name, we cannot handle adjustments due to daylight
savings times because we don't actually know the 'real' timezone of the
timestamp - we only know the tz offset at the point when the timestamp
was created. If we really want a solution which is able to handle
mobility and movement between different timezones and adjust for changes
in offsets due to daylight savings etc, you need to record the true full
timezone name, not the abbreviation. 


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 17:06                   ` Ihor Radchenko
  2023-01-14 17:13                     ` tomas
@ 2023-01-14 21:52                     ` Tim Cross
  2023-01-15 13:52                       ` Ihor Radchenko
  2023-01-15 20:03                       ` Jean Louis
  2023-01-15 19:52                     ` Jean Louis
  2 siblings, 2 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-14 21:52 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: tomas, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> tomas@tuxteam.de writes:
>
>>> ... Having an
>>> ability to specify time zones manually will already cater needs for a
>>> number of users.
>>
>> Definitely. But the time stamp (with time zone) in itself doesn't
>> carry enough context to actually decide that. It's even not that
>> easy to wrap one's head around dates that "travel" (the easiest
>> example would be perhaps: "9:00 show up at work" -- when DST takes
>> effect, it's still 9:00 whatever the local time is).
>
> This is basically what we have now - conform to "current" system time
> zone. We are not going to remove this timestamp style. Just add an
> ability to explicitly specify the timestamps if needed.
>
>> When you have appointments with people in totally diverse time zones,
>> perhaps dates tend to be more fixed wrt UTC.
>
> AFAIK, people don't usually bother. As long as you can map from specific
> time zone (applying the currently active summer clock time changes) to
> something like seconds from epoch, you can always calculate back to you
> preferred time zone. Look at https://www.emacswiki.org/emacs/Usergroups.
> They say, for example, "Europe/Berlin", which may be either CET or CEST.
>
> In any case, selection of time zone for user timestamps is not something
> we need to worry about in Org code. Users are to decide. Org might
> assist, but I do not see anything meaningful we can do to help with DST.

I think I basically agree with the last statement. However, perhaps we
need to step back and ask ourselves what it is that people do want which
drives this feature request. I doubt it is simply the ability to add TZ
information to timestamps. I suspect the underlying motivation here is
to have org mode actually use this information in a meaningful way,
which essentially means all the complicated stuff I'm concerned about
and which you seem to imply we wouldn't manage anyway.

To put it another way, we need to clarify what people mean when they
request the feature of timestamp support in org-mode datestamps. What
does this actually mean? Is it as simple as just being able to specify
the timezone (seems relatively easy to implement, but doens't really add
much) or is the expectation that once you have time zone information, it
will be used to do things like adjust date+time in agenda based on
change in locale or change in daylight savings status etc.

Clarifying the end goal will likely focus the discussion a lot
more. My interpretation, which could well be too extreme, is that people
want more than just the ability to add TZ info to their timestamps. They
want their agenda to reflect correct meeting/schedule times based on
their current locale, which may have changed since the initial timestamp
was recorded. They want time duration calculations which are able to
handle DS transitions etc, they want their agenda/calendar to adjust in
a similar way to how their Google calendar will adjust based on DS
transitions. 


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FR] Allow end date and max repeat count for timestamps with repeaters (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)
  2023-01-14 12:16             ` [FR] Allow end date and max repeat count for timestamps with repeaters (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Ihor Radchenko
@ 2023-01-15  1:09               ` Samuel Wales
  2023-01-15 13:45                 ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Samuel Wales @ 2023-01-15  1:09 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Russell Adams, emacs-orgmode

On 1/14/23, Ihor Radchenko <yantar92@posteo.net> wrote:
> However, I do not see why we cannot implement them within the current
> Org timestamp syntax:

my concern would be personal code and 3rd-party packages, which might
have their own peculiar parsing.

that parsing might even be of non-org files with org syntax that is
embedded in another syntax.  [like, parsing diffs of org, with
planning line tses and perhaps trying to accommodate various user
settings for org indentation where possible.]

if otoh org provides really good api that can even do that, then i
suppose you could tell those devs to use that api.

also my personal preference is for less new org syntax.  which is one
reason why i like cl-style sexp kw for future features and
subfeatures.  syntax can be hard to look up in the org manual, hard to
remember, etc.  but that's mho.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 20:30             ` Tim Cross
@ 2023-01-15  4:00               ` Max Nikulin
  2023-01-15  7:53                 ` Tim Cross
  2023-01-15 14:00                 ` Ihor Radchenko
  0 siblings, 2 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-15  4:00 UTC (permalink / raw)
  To: emacs-orgmode

On 15/01/2023 03:30, Tim Cross wrote:
> The UTC time stays the same, but the
> meeting time for me changes twice per year (moving forward/backward an
> hour).

Meeting time remains the same expressed as local time (15:00), but 
alternates between 04:00 and 05:00 UTC. So repeating schedule can not be 
stored as UTC, instead UTC timestamp should be calculated from local 
time for each date. (Even libc can do it while you work with single 
timezone.) It is OK to store in UTC already passed events, but local 
time still may be more compact and user friendly.

Actually I am trying to draw attention to a more tricky case when 
timestamp stored as local time is even more important. Event time is 
bound to local time, and timezone database changed due to new rules for 
this time zone: the government decided to cancel or introduce DST 
transitions or to extend/shorten interval when daylight saving time is 
active. For a timezone without DST time offset may be changed as well.

While timezone database is stable, you can calculate UTC timestamps for 
any moments expressed in local time. When new rules are published some 
future UTC timestamps become invalid. If you know local time, you may 
update UTC timestamps. If you store just UTC timestamp you have a trouble.

Paul Eggert provided an example of updating time transition history, so 
what is authoritative: local time or UTC, applies to the past as well. 
However I do not agree with Paul completely. It is necessary to decide 
for each timestamp, what is the primary data, time offset (so timezone 
identifier should be updated) or local time (so time offset should be 
updated keeping timezone identifier).

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54764#30
Re: bug#54764: encode-time: make DST and TIMEZONE fields of the list
Thu, 14 Apr 2022 15:46:58 -0700
> 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.

So keeping redundant information may be crucial to get warnings that 
some timestamps need to be reviewed.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 15:05               ` Ihor Radchenko
  2023-01-14 16:50                 ` tomas
@ 2023-01-15  4:37                 ` Max Nikulin
  2023-01-15  5:03                 ` Max Nikulin
  2 siblings, 0 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-15  4:37 UTC (permalink / raw)
  To: emacs-orgmode

On 14/01/2023 22:05, Ihor Radchenko wrote:
> In addition, we may provide some mechanism to set the time zone for:
> 1. Individual files
> 2. For all files, including possible time zone transitions over time.
> 
> What I mean by (2) is when the user travels from, say, Australia to USA,
> it could be possible to say: Use Australia/Seattle up to certain time
> and then use USA/Austin.

I like this idea.

Having a time handling library supporting custom ad hoc timezones it 
would be possible to create a special zone for such trip. Its time 
offset and naming rules follows locations of the trip. As a result, 
supplying various timezones to agenda generation code it would be 
possible to generate schedule for
- the traveling user with time local to each trip point (custom TZ)
- colleagues and relatives staying at the departure point (original TZ)
- accepting party (destination TZ)

For a timestamp without explicit timezone it may be obtained from
- subtree or file property (single value or list of time intervals 
reflecting history of timezone changes)
- buffer local variable (single TZ or history)
- global org variable (single TZ or history)
- timezone (single value) set inside libc (e.g. initialized from the TZ 
environment or changed by code)
- system timezone.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 15:05               ` Ihor Radchenko
  2023-01-14 16:50                 ` tomas
  2023-01-15  4:37                 ` Max Nikulin
@ 2023-01-15  5:03                 ` Max Nikulin
  2023-01-15 20:28                   ` Jean Louis
  2 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-15  5:03 UTC (permalink / raw)
  To: emacs-orgmode

On 14/01/2023 22:05, Ihor Radchenko wrote:
> <tomas@tuxteam.de> writes:
> 
>> Now there's still enough work for the applications to do: presentation,
>> parsing, disambiguation, if necessary asking the user for help. Someone
>> mentioned PostgreSQL -- this is a nice example of what can be done beyond
>> the (comparatively!) boring details of time zone management :-)
> 
> Do I understand correctly that PostgreSQL insists on using timestamps
> with time zone info in favour or ordinary timestamps? Exactly to avoid
> issues with the same timestamp pointing to a different real time from
> epoch depending on the current OS time zone setting?

My points of what that wiki page tries to say:

PostgreSQL has better support of timezone conversions than some of other 
databases or middleware libraries. That is why taking advantage of the 
postgres feature allows to create more reliable application. The recipe 
is to allow postgres to store timestamps in UTC and to delegate it time 
conversion by specifying "timestamp with time zone" type.

"With time zone" does not mean that original time zone is stored. It is 
converted to UTC from explicitly specified timezone or from the one set 
for client's connection.

Some postgres time related types was added just because they are 
required to pass SQL compliance tests or to allow easier migration from 
other databases. They should be avoided when possible.

I totally agree with the recommendation to use timestamptz for data 
related to something in history: billing, bank transactions, etc.

However it is call to trouble for planned events and schedules. Not 
frequent, so almost untested use cases.

If I remember correctly, another type, timestamp (without tz), may be 
cast on demand to any timezone (stored in another column or passed from 
application). So it may be used obtain correct UTC timestamp after 
update of timezone database.

> Thinking more about this, I can see how it can be important for
> clocking, and similar auto-recorded information. Users may be surprised
> to record clocking on some task yesterday just to find the clocking data
> in future upon travelling from Singapore to San Fran.

In the case of crossing international date line it is certainly an 
issue. Users often crossing of timezone border with several hours time 
difference may need to specify timezone explicitly as well. For others 
timezone change history should be enough to calculate duration of 
clocking intervals from regular local time.




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 11:42       ` Ihor Radchenko
@ 2023-01-15  5:11         ` Max Nikulin
  2023-01-15 13:41           ` Ihor Radchenko
  2023-01-20 10:57         ` Ihor Radchenko
  1 sibling, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-15  5:11 UTC (permalink / raw)
  To: emacs-orgmode

On 14/01/2023 18:42, Ihor Radchenko wrote:
> 
> <2023-01-14 Sat 18:22@Asia/Singapore>  (SGD and similar abbreviations are often ambiguous)

Such format is ambiguous for timezones with DST around backward time 
jump. Before/after time transition should be specified in addition, e.g. 
by combining identifier and offset or some way to state namely before or 
after.

> <2023-01-14 Sat 18:22+0800>
> <2023-01-14 Sat 18:22+08>
> <2023-01-14 Sat 18:22@+0800>
> <2023-01-14 Sat 18:22@+08>

May become incorrect for future events due to updates of timezone database.

> <2023-01-14 Sat 18:22@+08 +1w -5d>

May be not suitable for time zones with DST since offset changes due to 
time transitions.

I am afraid, sometimes rather long (maybe even redundant) specification 
is required, so overlays becomes must have (as for links) to keep 
readability.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 19:43         ` Tim Cross
@ 2023-01-15  6:37           ` tomas
  2023-01-15 14:07           ` Ihor Radchenko
  2023-01-15 19:14           ` Jean Louis
  2 siblings, 0 replies; 330+ messages in thread
From: tomas @ 2023-01-15  6:37 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2213 bytes --]

On Sun, Jan 15, 2023 at 06:43:19AM +1100, Tim Cross wrote:
> Max Nikulin <manikulin@gmail.com> writes:
> 
> > On 14/01/2023 20:08, Jean Louis wrote:
> >> * Max Nikulin [2023-01-14 10:14]:
> >>> Let's assume <2023-01-15 Sun 09:00 +1>
> >>>
> >>> It may be suitable for timestamps in the past, but future is more tricky.
> >>> There is no problem if you are going to watch Lunar eclipse. However if your
> >>> plan is to attend a local event there is a chance that you will arrive at
> >>> wrong time. Sometimes offset of timezones is changed and it may happen
> >>> between the moment when you added a scheduled time and the moment of the
> >>> event.
> >> Can't follow you.
> >> with "+1" I would say it is time zone.
> >> Basic point is that users shall learn to express themselves by using
> >> time zone.
> >
> > "+1" is not a timezone, it is current offset shared by several timezones. You can not
> > assure that time offset at a particular location would not change due to new
> > administrative rules.
> >
> > E.g. Europe/Berlin is a timezone, but, strictly speaking, is still
> > underspecified. Sometimes timezones are split into smaller parts.
> 
> Yes, this is a problem. We really want a symbolic TZ
> specification and we would need 'smarts' i the timestamp generation code
> that is able to handle potential offset changes due to daylight savings
> transition etc. Even then, the transition time can change between when
> the timestamp is set for and when it actually occurs.

Having wrangled that (outside Emacs) for a while, I politely disagree.

If it's the past we are talking about, the offset is most of the time
the right thing (we know best at timestamp creation time). When it's
the future /and/ we are talking about local time, then the symbolic
time zone makes more sense (e.g. we meet in Lviv next Monday at 3pm,
whatever 3pm is in that timezone).

I think we need (optionally) both. Well knowing that some dates with
some symbolic time zones are ambiguous.

For a log file (past times), for example, I would insist in having the
offset (actually I'd try to talk people into having UTC, but have failed
at times with that).

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15  4:00               ` Max Nikulin
@ 2023-01-15  7:53                 ` Tim Cross
  2023-01-15 19:26                   ` Jean Louis
  2023-01-15 14:00                 ` Ihor Radchenko
  1 sibling, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-15  7:53 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 15/01/2023 03:30, Tim Cross wrote:
>> The UTC time stays the same, but the
>> meeting time for me changes twice per year (moving forward/backward an
>> hour).
>
> Meeting time remains the same expressed as local time (15:00), but alternates between
> 04:00 and 05:00 UTC. So repeating schedule can not be stored as UTC, instead UTC timestamp
> should be calculated from local time for each date. (Even libc can do it while you work
> with single timezone.) It is OK to store in UTC already passed events, but local time
> still may be more compact and user friendly.
>
> Actually I am trying to draw attention to a more tricky case when timestamp stored as
> local time is even more important. Event time is bound to local time, and timezone
> database changed due to new rules for this time zone: the government decided to cancel or
> introduce DST transitions or to extend/shorten interval when daylight saving time is
> active. For a timezone without DST time offset may be changed as well.
>
> While timezone database is stable, you can calculate UTC timestamps for any moments
> expressed in local time. When new rules are published some future UTC timestamps become
> invalid. If you know local time, you may update UTC timestamps. If you store just UTC
> timestamp you have a trouble.
>
> Paul Eggert provided an example of updating time transition history, so what is
> authoritative: local time or UTC, applies to the past as well. However I do not agree with
> Paul completely. It is necessary to decide for each timestamp, what is the primary data,
> time offset (so timezone identifier should be updated) or local time (so time offset
> should be updated keeping timezone identifier).
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54764#30
> Re: bug#54764: encode-time: make DST and TIMEZONE fields of the list
> Thu, 14 Apr 2022 15:46:58 -0700
>> 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.
>
> So keeping redundant information may be crucial to get warnings that some timestamps need
> to be reviewed.

WRT future timestamps, we would probably have to take the same approach
as postgres i.e. the timezone rules in force at the time the timestamp
is created are assumed to be 'forever'. While this is not true, it is
really the only solution you can adopt and you just have ot accept that
there is the chance that the rule will change in the future and the
timestamp will then be incorrect.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15  5:11         ` Max Nikulin
@ 2023-01-15 13:41           ` Ihor Radchenko
  2023-01-16 16:43             ` Max Nikulin
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-15 13:41 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 14/01/2023 18:42, Ihor Radchenko wrote:
>> 
>> <2023-01-14 Sat 18:22@Asia/Singapore>  (SGD and similar abbreviations are often ambiguous)
>
> Such format is ambiguous for timezones with DST around backward time 
> jump. Before/after time transition should be specified in addition, e.g. 
> by combining identifier and offset or some way to state namely before or 
> after.

Are you referring to one hour in year when the clock is moved one hour
forward?

<2023-10-29 Sun 3:00@+DST/Europe/Berlin> -> (+1 minute)
<2023-10-29 Sun 2:01@-DST/Europe/Berlin>

I, however, do not feel like we need this +/-DST special notation.
Chances that one needs a timestamp in this specific hour are slim. At
the end, countries deliberately choose the time transition to not
interfere with business activity.

Instead, we can simply allow
https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
formats. All of them are supported by `encode-time' anyway.

At least, in theory.
I just tried:

(time-subtract
(encode-time 0 1 3 29 10 2023 nil -1 ":Europe/Berlin")
(encode-time 0 59 2 29 10 2023 nil -1 ":Europe/Berlin"))

(see https://www.timeanddate.com/time/zone/germany/berlin)

and it looks like the expected return value should be 1 hour 2 minutes
(3720), but it is not, on my system.

I am probably missing something though.

>> <2023-01-14 Sat 18:22+0800>
>> <2023-01-14 Sat 18:22+08>
>> <2023-01-14 Sat 18:22@+0800>
>> <2023-01-14 Sat 18:22@+08>
>
> May become incorrect for future events due to updates of timezone database.

Emm. No? +8 is offset from UTC. It will not be affected by anything.
Or are you referring to scenarios when user actually wants to specify the
timestamp for specific country/city? Then the TZ variant should be used
instead.

What I am essentially proposing in these examples is allowing:
1. TZ format as described in https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
2. ISO 8601 format https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators

Of course, individual variants of time zone specs may be ambiguous
depending on the purpose. Users are to choose what they prefer

>> <2023-01-14 Sat 18:22@+08 +1w -5d>
>
> May be not suitable for time zones with DST since offset changes due to 
> time transitions.
>
> I am afraid, sometimes rather long (maybe even redundant) specification 
> is required, so overlays becomes must have (as for links) to keep 
> readability.

Not necessarily. Most of the timestamps can do just fine specifying
either explicit offset or a time zone name:

<2023-01-14 Sat 18:22@Asia/Singapore>
<2023-01-14 Sat 18:22+08>

More exotic scenarios will not be common.

And, if the users wish, we do have `org-time-stamp-custom-formats'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FR] Allow end date and max repeat count for timestamps with repeaters (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)
  2023-01-15  1:09               ` Samuel Wales
@ 2023-01-15 13:45                 ` Ihor Radchenko
  2023-01-15 23:49                   ` Samuel Wales
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-15 13:45 UTC (permalink / raw)
  To: Samuel Wales; +Cc: Russell Adams, emacs-orgmode

Samuel Wales <samologist@gmail.com> writes:

> On 1/14/23, Ihor Radchenko <yantar92@posteo.net> wrote:
>> However, I do not see why we cannot implement them within the current
>> Org timestamp syntax:
>
> my concern would be personal code and 3rd-party packages, which might
> have their own peculiar parsing.

I proposed a single slight change in timestamp syntax:

<2023-01-14 Sat +1w/5x>

However, it is almost the same with what we have for habits:

<2023-01-14 Sat +1w/2w>

I do not see how things are going to break even if third-party packages
use some home-grown parsers.

> if otoh org provides really good api that can even do that, then i
> suppose you could tell those devs to use that api.

`org-get-repeat', `org-get-wdays', and `org-element-timestamp-parser'.

> also my personal preference is for less new org syntax.  which is one
> reason why i like cl-style sexp kw for future features and
> subfeatures.  syntax can be hard to look up in the org manual, hard to
> remember, etc.  but that's mho.

My proposal is as little new syntax as I was able to come up with.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 21:52                     ` Tim Cross
@ 2023-01-15 13:52                       ` Ihor Radchenko
  2023-01-20 14:34                         ` Alexander Adolf
  2023-01-15 20:03                       ` Jean Louis
  1 sibling, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-15 13:52 UTC (permalink / raw)
  To: Tim Cross; +Cc: tomas, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

>> In any case, selection of time zone for user timestamps is not something
>> we need to worry about in Org code. Users are to decide. Org might
>> assist, but I do not see anything meaningful we can do to help with DST.
>
> I think I basically agree with the last statement. However, perhaps we
> need to step back and ask ourselves what it is that people do want which
> drives this feature request. I doubt it is simply the ability to add TZ
> information to timestamps. I suspect the underlying motivation here is
> to have org mode actually use this information in a meaningful way,
> which essentially means all the complicated stuff I'm concerned about
> and which you seem to imply we wouldn't manage anyway.

I don't imply that. What I am saying is that we first need to decide on
syntax and provide basic support for time zones. It will already be
helpful as I won't need to convert timestamps into local time or think
if I need to convert timestamps ahead of time before a flight to
different time zone.

More things can be implemented once we have the basic support.

> To put it another way, we need to clarify what people mean when they
> request the feature of timestamp support in org-mode datestamps. What
> does this actually mean? Is it as simple as just being able to specify
> the timezone (seems relatively easy to implement, but doens't really add
> much) or is the expectation that once you have time zone information, it
> will be used to do things like adjust date+time in agenda based on
> change in locale or change in daylight savings status etc.

Converting timestamps with time zone to local time is indeed one of the
basic features we need to support.

> Clarifying the end goal will likely focus the discussion a lot
> more. My interpretation, which could well be too extreme, is that people
> want more than just the ability to add TZ info to their timestamps. They
> want their agenda to reflect correct meeting/schedule times based on
> their current locale, which may have changed since the initial timestamp
> was recorded. They want time duration calculations which are able to
> handle DS transitions etc, they want their agenda/calendar to adjust in
> a similar way to how their Google calendar will adjust based on DS
> transitions. 

I do not see any obstacle to having these basic features either. We
already use `encode-time' in time calculations across Org. So, all the
operations on times already use internal time representation. We will
get all the features you named pretty much for free just by supplying
time zone to `encode-time' calls.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15  4:00               ` Max Nikulin
  2023-01-15  7:53                 ` Tim Cross
@ 2023-01-15 14:00                 ` Ihor Radchenko
  1 sibling, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-15 14:00 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54764#30
> Re: bug#54764: encode-time: make DST and TIMEZONE fields of the list
> Thu, 14 Apr 2022 15:46:58 -0700
>> 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.
>
> So keeping redundant information may be crucial to get warnings that 
> some timestamps need to be reviewed.

My takeaway from here is that automatically generated timestamps for
past events should better contain redundant information:

"1950-07-01 00:00:00 +0000 Europe/Lisbon"

+0000 is what matters for time calculation while Europe/Lisbon indicates
the actual timezone being implied.

Then, if there is an event of TZ database change, Org might compare
+0000 vs. Europe/Lisbon and display warning if there is discrepancy.

For us, it means that we might potentially reserve 

<1950-07-01 00:00:00+0000@Europe/Lisbon> as a valid timestamp format.
Warning is optional feature we might implement in future.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 19:43         ` Tim Cross
  2023-01-15  6:37           ` tomas
@ 2023-01-15 14:07           ` Ihor Radchenko
  2023-01-15 20:43             ` Tim Cross
  2023-01-15 19:14           ` Jean Louis
  2 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-15 14:07 UTC (permalink / raw)
  To: Tim Cross; +Cc: Max Nikulin, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> Unfortunately, the common abbreviated forms like EST, AEST etc are
> inconsistent here. Some places will have a standard and a daylight
> savings type i.e. AEST and AEDT, while others will have just AEST. TO
> make it worse, two locations with the same time zone offset my use
> different versions i.e. Australia/Melbourn is AEST (+10/+11) and
> Australia/Sydney is AEST (+10) and AEDT (+11) and Australia/Brisbane is
> just AEST (+10). If everywhere which has daylight savings ensured they
> used a different abbreviation for daylight saving and non-daylight
> saving times, life would be easier, but they don't). Then of course
> there are many countries which don't have a symbolic letter abbreviation
> i.e. just have e.g -05 as their abbreviated TZ name.
>
> It is this and other related reasons why just relying on Emacs' internal
> API for times and dates is not sufficient. The abbreviated times have
> ambiguity and the full timezone specification is cumbersome and
> ugly. Even worse is that issue won't be shown up as failures - you will
> just silently get wrong results.  

So, basically we may need a way to (1) identify ambiguous TZ
specifications; (2) signal to user about potential issues.

Note that these are also optional features we may implement any time
once we have basic timezone support.

For (2) we may use something similar to `world-clock' - display user
timestamp at point for different time zones. Maybe via eldoc.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 13:22       ` Ihor Radchenko
@ 2023-01-15 19:10         ` Jean Louis
  2023-01-16 11:21           ` Ihor Radchenko
  2023-01-15 20:43         ` Jean Louis
  1 sibling, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-15 19:10 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Tim Cross, Daryl Manning, emacs-orgmode

* Ihor Radchenko <yantar92@posteo.net> [2023-01-14 16:23]:
> But why do we need any time zone data? All we need to converting from
> and to internal Emacs' time representation supplying the correct time
> zone to it.

When Org file is very personal and location centric, then there is no
need for it.

When Org file has assigned, shared tasks, and is related to other
people in various locations over the world, then it becomes important.

And when people travel from place to place they change time zones. You
changed it personally I bet, sometimes, did you? But as your work is
very personal it does not matter.

A record in Org file must be Org specific record. I guess that with
the general timezone property, such Org file, provided it has all the
same time zone, can have that specific time zone, and if shared to
somebody in other zone, that other person will see accurate time.

Because Org is very much single user centric for majority will not
matter really.

I can just imagine person in Brazil writing time zone records, so it
makes sense to know in which time zone that record was done, as if
somebody reads it in India, it will make less sense and it could cause
confusion.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 16:58       ` Max Nikulin
  2023-01-14 19:43         ` Tim Cross
@ 2023-01-15 19:12         ` Jean Louis
  1 sibling, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-15 19:12 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

* Max Nikulin <manikulin@gmail.com> [2023-01-14 19:59]:
> On 14/01/2023 20:08, Jean Louis wrote:
> > * Max Nikulin [2023-01-14 10:14]:
> > > Let's assume <2023-01-15 Sun 09:00 +1>
> > > 
> > > It may be suitable for timestamps in the past, but future is more tricky.
> > > There is no problem if you are going to watch Lunar eclipse. However if your
> > > plan is to attend a local event there is a chance that you will arrive at
> > > wrong time. Sometimes offset of timezones is changed and it may happen
> > > between the moment when you added a scheduled time and the moment of the
> > > event.
> > 
> > Can't follow you.
> > 
> > with "+1" I would say it is time zone.
> > 
> > Basic point is that users shall learn to express themselves by using
> > time zone.
> 
> "+1" is not a timezone, it is current offset shared by several timezones.
> You can not assure that time offset at a particular location would not
> change due to new administrative rules.

Fine, that was example to indicat time zone. I don't really use Org
for timestamps since quite some time, as every time stamp on my side
must be stored in database.

My Org usage is with generated read-only buffers these days. It is
good for representation and sometimes conversion to other files.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 19:43         ` Tim Cross
  2023-01-15  6:37           ` tomas
  2023-01-15 14:07           ` Ihor Radchenko
@ 2023-01-15 19:14           ` Jean Louis
  2023-01-16  4:20             ` Max Nikulin
  2 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-15 19:14 UTC (permalink / raw)
  To: Tim Cross; +Cc: Max Nikulin, emacs-orgmode

* Tim Cross <theophilusx@gmail.com> [2023-01-14 23:25]:
> Yes, this is a problem. We really want a symbolic TZ
> specification and we would need 'smarts' i the timestamp generation code
> that is able to handle potential offset changes due to daylight savings
> transition etc. Even then, the transition time can change between when
> the timestamp is set for and when it actually occurs.

As PostgreSQL type TIMESTAMP WITH TIME ZONE is stored with underlying
UTC time, so should be Org times also be calculated with underlying
UTC times.

And in that case I just assume that operating system libraries ar
handling problem you have stated.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
@ 2023-01-15 19:16 Thomas S. Dye
  0 siblings, 0 replies; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-15 19:16 UTC (permalink / raw)
  To: emacs-orgmode

Aloha all,

IIUC, timestamps in Org might be used to track two things: events 
and occurrences.

An event refers to a particular region of space/time, in Org's 
case the space/time occupied by the user, regardless of which time 
zone the user occupies.  An event might be "Brush teeth before 
bed" set for 10:00 PM, which the user would want to make happen at 
that time, regardless of the time of day in the timezone in which 
the timestamp was applied to the event.

An occurrence refers to changes in the nature and relations of 
substances at a time.  It takes place in absolute time in order to 
avoid circularity.  An occurrence might be "Attend virtual 
meeting" set for 9:00 AM on a certain day, which the user would 
want to make happen at 9:00 AM on that day in the time zone where 
the timestamp was applied to the occurrence, regardless of the 
time zone where the user happened to be.

I found this distinction in a book called On Truth by Frank 
Ramsey, that was unfinished at his untimely death at age 26. 
"Event" and "occurrence" were Ramsey's suggestions.  He seemed to 
like "event", but thought "occurrence" would work, though it might 
be improved.

I enjoy having terms for these two kinds of happenings and I'm 
hopeful you'll find them useful, too.

All the best,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15  7:53                 ` Tim Cross
@ 2023-01-15 19:26                   ` Jean Louis
  2023-01-16 13:20                     ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-15 19:26 UTC (permalink / raw)
  To: Tim Cross; +Cc: Max Nikulin, emacs-orgmode

* Tim Cross <theophilusx@gmail.com> [2023-01-15 10:58]:
> WRT future timestamps, we would probably have to take the same
> approach as postgres i.e. the timezone rules in force at the time
> the timestamp is created are assumed to be 'forever'. While this is
> not true, it is really the only solution you can adopt and you just
> have ot accept that there is the chance that the rule will change in
> the future and the timestamp will then be incorrect.

Not sure if that is so. It is about representation. 

Database user in different time zone would see different time in his
time zone, while user in other time zone would see it different. This
makes more sense for people then using UTC, which is confusing for
people and which would imply that people somehow have to convert UTC
to their local time. Isn't it?

Imagine online meeting with 2 people in different time zones, they
share the Org heading with time stamp, but when user opens that Org
heading in Florida, will see different time according to his time
zone, while user in East Africa will see different time. 

Due to correct representation, both users now know when is the meeting
taking place, and they meet in same time.

If they would share UTC time, or any time without time zone
representation, they would get time coordination difficulties.

The type TIMESTAMP WITH TIME ZONE in PostgreSQL is always stored as
UTC and time zone rules are not forever.

The type TIMESTAMP WITH TIME ZONE automatically converts to proper
time zone. 

One could think for Org to simply become able to designate time zone
somewhere, be it generally for Org file or/and specific heading, or/and
specific timestamp. 

Then implement function to transform time to UTC, and then use
libraries or Emacs to transform UTC to designated time zone.

https://www.postgresql.org/docs/15/datatype-datetime.html

For timestamp with time zone, the internally stored value is always in
UTC (Universal Coordinated Time, traditionally known as Greenwich Mean
Time, GMT). An input value that has an explicit time zone specified is
converted to UTC using the appropriate offset for that time zone. If
no time zone is stated in the input string, then it is assumed to be
in the time zone indicated by the system's TimeZone parameter, and is
converted to UTC using the offset for the timezone zone.

When a timestamp with time zone value is output, it is always
converted from UTC to the current timezone zone, and displayed as
local time in that zone. To see the time in another time zone, either
change timezone or use the AT TIME ZONE construct (see Section 9.9.4).

Conversions between timestamp without time zone and timestamp with
time zone normally assume that the timestamp without time zone value
should be taken or given as timezone local time. A different time zone
can be specified for the conversion using AT TIME ZONE.



-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 17:06                   ` Ihor Radchenko
  2023-01-14 17:13                     ` tomas
  2023-01-14 21:52                     ` Tim Cross
@ 2023-01-15 19:52                     ` Jean Louis
  2023-01-16 13:11                       ` Ihor Radchenko
  2 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-15 19:52 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: tomas, emacs-orgmode

* Ihor Radchenko <yantar92@posteo.net> [2023-01-14 20:08]:
> > When you have appointments with people in totally diverse time zones,
> > perhaps dates tend to be more fixed wrt UTC.
> 
> AFAIK, people don't usually bother.

Can't agree to that, we who do bother will simply find different
solutions but Org, like I have developed it for myself or other CRM
systems where all time issues are solved fundamentally on the database
level.

Haven thanks, it is very easy within seconds to find how many people
are affected by time zones, so I have run 

"SELECT DISTINCT get_contacts_name(hyobjects_assignedperson) FROM
hyobjects WHERE hyobjects_assignedperson IS NOT NULL;"

And I got round number of 50 people! 

All our staff members used Org mode before, now not, there is no need
for it, apart from few lines, or generated Org buffers for usage
similar like browsing. And this is only for reasons of having fancier
themes. 

You can't know if people bother if you do not ask. 

Yes, I feel that it is not considerate enough when you say that people
don't usually bother. 

When I expressed my on this mailing list that there are issues, that
was back in time, and I would consider any issue here mentioned ever
once, that "people do bother". 

In media and newspaper business, we know that when there is one
reader's letter, that there are 1000 other people who have the same
opinion. Maybe statistics changed, but you should use that principle
on mailing list and in any community software development. One person
writing on mailing list may mean hundreds affected in background.

I can observe on other development places that people raise issue
before 10 years, before 8 years, until it finally gets solved, and the
package get its boost because it became really useful.

All the people who were direct and indirect users of Org mode since
2016, switched to different system. They are not bothered to learn
about Org, which is useful as it minimizes distraction. Though Org
mode remains useful in work of managers.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 17:13                     ` tomas
@ 2023-01-15 19:54                       ` Jean Louis
  0 siblings, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-15 19:54 UTC (permalink / raw)
  To: tomas; +Cc: Ihor Radchenko, emacs-orgmode

* tomas@tuxteam.de <tomas@tuxteam.de> [2023-01-14 20:16]:
> What I can imagine being useful (besides allowing timestamps to carry
> that extra info) is the possibility to set defaults, perhaps at the
> file (even, who knows, at the heading) level. A special attribute
> seems pretty adequate, if I'm not missing some monster.

So far only supported for iCalendar backend:

(info "(org) iCalendar Export")

Though it should be supported on file level, then any timezone can be
recalculated for representation.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 21:52                     ` Tim Cross
  2023-01-15 13:52                       ` Ihor Radchenko
@ 2023-01-15 20:03                       ` Jean Louis
  1 sibling, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-15 20:03 UTC (permalink / raw)
  To: Tim Cross; +Cc: Ihor Radchenko, tomas, emacs-orgmode

* Tim Cross <theophilusx@gmail.com> [2023-01-15 01:13]:
> I think I basically agree with the last statement. However, perhaps we
> need to step back and ask ourselves what it is that people do want which
> drives this feature request. I doubt it is simply the ability to add TZ
> information to timestamps. I suspect the underlying motivation here is
> to have org mode actually use this information in a meaningful way,
> which essentially means all the complicated stuff I'm concerned about
> and which you seem to imply we wouldn't manage anyway.

It means for representation and calculations.

Person in East Africa writes task to somebody in Washington, with
deadline with time zone in Croatia, when notary has to sign a document
for somebody in Croatia. Because there is hypothetical timezone
parameter at file, or header level or timestamp level, then user in
Washington can see proper time in his time zone.

Representation should depend on user's local system. But how to know
how to display the time, without having time zone defined in first
place?

It requires global timezone parameter, heading and timestamp based.

Apparently it is confusing and asks for work. Sorry for that. It is
something one had to think ahead of time when dealing with people all
over the world. 

I think that any function reading timestamps should get its "bypass"
to re-calculate timestamp according to specified time zone.

If user Joe in East Africa wrote a meeting appointment with person in
Greek by Greek timezone, and sent that appointment to Washington, USA,
then person in Washington should read the time in his time zone, and
would know when is meeting accurately, in how many hours for him. 

Greek, East African and Washington people would all see different
times, but would meet accurately at same time.

> To put it another way, we need to clarify what people mean when they
> request the feature of timestamp support in org-mode datestamps. What
> does this actually mean? Is it as simple as just being able to specify
> the timezone (seems relatively easy to implement, but doens't really add
> much) or is the expectation that once you have time zone information, it
> will be used to do things like adjust date+time in agenda based on
> change in locale or change in daylight savings status etc.

I am sure that adjustments must come there. 

Practically, Org headings and files are easily shareable. Users in
different time zones could instead plan their own, receive the agenda
planned by other people, they would see it in their own calculated
time zone, while other people watching same agenda, would see it in
their own.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 20:56                   ` Tim Cross
@ 2023-01-15 20:24                     ` Jean Louis
  0 siblings, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-15 20:24 UTC (permalink / raw)
  To: Tim Cross; +Cc: tomas, Ihor Radchenko, emacs-orgmode

* Tim Cross <theophilusx@gmail.com> [2023-01-15 00:40]:
> The internal representation of timestamps used by Postgres is ALWAYS
> UTC, regardless of whether the field was defined as timestamp or
> timestamp with timezone.

Right.

> The only real difference is that if the field is defined as just
> timestamp, postgres assumes the data being entered is in local time
> and will adjust using the local timezone offset.

I was never thinking about it because I have never observed it or
maybe I was unable to see it. I don't see it is adjusting
anything. Because time without time zone is just UTC time, so it is
not adjusting, but adding the time.

CREATE TABLE my (timestamp_without timestamp without time zone default
now(), 
                timestamp_with timestamp with time zone default
		now());


\d my
                                Table "public.my"
      Column       |            Type             | Collation | Nullable | Default 
-------------------+-----------------------------+-----------+----------+---------
 timestamp_without | timestamp without time zone |           |          | now()
 timestamp_with    | timestamp with time zone    |           |          | now()

[local] maddox@admin=# insert into my default values;
INSERT 0 1
[local] maddox@admin=# select * from my;
     timestamp_without      |        timestamp_with         
----------------------------+-------------------------------
 2023-01-15 23:07:35.753599 | 2023-01-15 23:07:35.753599+03
(1 row)

What if user comes to UTC time zone by Greenwich and then sets the
time zone with PostgreSQL:

SET TIME ZONE 'UTC';

select * from my;
     timestamp_without      |        timestamp_with         
----------------------------+-------------------------------
 2023-01-15 23:07:35.753599 | 2023-01-15 20:07:35.753599+00
(1 row)

One can see that time stamp with time zone is being adjusted.

Because it is not same time:

select timestamp_with - timestamp_without from my;
 ?column?  
-----------
 -03:00:00

There is 3 hours difference, though the entry in the database was in
the same time and time "looks same" while it is not.

The difference is not that PostgreSQL adjusts something but timestamp
without time zone is treated as UTC and with time zones is treated as
different to UTC, those are different times then even though they may
look apparently same.

> It will ignore any tz information in the input. If the field is
> defined as timestamp with time zone, it will use the offset defined
> by the timezone in the input to determine the UTGC value.

Or no need for offset, as in the above example.

> When displaying a timestamp, postgres always uses the local time
> zone unless you request a different timezone using the 'at time
> zone' construct.

Actualy not, it does not always use local time zone, as for timestamp
without time zone, it does not show any different representation
regardless of local time zone:

set time zone '+4';
SET
[local] maddox@admin=# select * from my;
     timestamp_without      |        timestamp_with         
----------------------------+-------------------------------
 2023-01-15 23:07:35.753599 | 2023-01-16 00:07:35.753599+04

> >> Thinking more about this, I can see how it can be important for
> >> clocking, and similar auto-recorded information. Users may be surprised
> >> to record clocking on some task yesterday just to find the clocking data
> >> in future upon travelling from Singapore to San Fran.

That is so much right.

> >> So, when implementing time zones, we may need to take care about adding
> >> the time zone info when auto-inserting timestamps.

That is good conclusion. It just comes so late in time.

> >> In addition, we may provide some mechanism to set the time zone for:
> >> 1. Individual files
> >> 2. For all files, including possible time zone transitions over
> >> time.

One has system time, but one can work with different system file and
specifying different time zone, so yes, one shall have global options
of the time zone, which should allow settings different than system
time. 

It requires in Org export to understand what is local time zone so
that Org export can set global variable of local time zone, as if it
was not set, so that when Org file is used in different time zone,
that proper time calculation can take place.

Settings shall be available:

- based on operating system time zone;

- which could be rewritten by Org settings for all files;

- which could be rewritten by file setting;

- which could be rewritten by heading property;

- which could be rewritten by timestamp itself;

Then the function reading timestamps should understand it, and later
provide all calculations.

> > Definitely. But the time stamp (with time zone) in itself doesn't
> > carry enough context to actually decide that.

Ha, ha, that is right, as time with time zone in Org context is not
UTC time internally, so that way is very difficult to achieve
accuracy, as it should involve all political changes about time zones
at any time point in past and in future. 

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15  5:03                 ` Max Nikulin
@ 2023-01-15 20:28                   ` Jean Louis
  2023-01-16 13:17                     ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-15 20:28 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

* Max Nikulin <manikulin@gmail.com> [2023-01-15 08:05]:
> I totally agree with the recommendation to use timestamptz for data related
> to something in history: billing, bank transactions, etc.
> 
> However it is call to trouble for planned events and schedules. Not
> frequent, so almost untested use cases.
> 
> If I remember correctly, another type, timestamp (without tz), may be cast
> on demand to any timezone (stored in another column or passed from
> application). So it may be used obtain correct UTC timestamp after update of
> timezone database.

It is about representation.

If time is represented as UTC, by user in Brazil, how is somebody in
Russia going to understand when is the meeting?

Call for trouble is when there is UTC time only as that requires users
to calculate themselves the different time zone, instead, computer is
for such calculations there.

When time is specified with time zone, then user in any ther time
zone can see that in his own time zone.

In the context of Org files, that would mean that there must exist
function which would convert time zone timestamps into local time zone
for proper representation.

Only with such functions problems are gone.

Without such function to convert time zones in different time zone,
user will see time zone from Brazil and will run into difficulties.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 13:22       ` Ihor Radchenko
  2023-01-15 19:10         ` Jean Louis
@ 2023-01-15 20:43         ` Jean Louis
  2023-01-16 11:25           ` Ihor Radchenko
  1 sibling, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-15 20:43 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Tim Cross, Daryl Manning, emacs-orgmode

* Ihor Radchenko <yantar92@posteo.net> [2023-01-14 16:23]:
> Tim Cross <theophilusx@gmail.com> writes:
> 
> > Consider for example an agenda file where the TODO items have been added
> > while I am here in Australia (currently +11:00 w/ DST). Tomorrow I fly
> > to Europe where I will be working for the next 6 weeks. I need all my
> > TODOs with active timestamps to be updated to Berlin's TZ. How does this
> > work?
> 
> I am not sure what is the problem.
> The timestamps that should stay in local time will be automatically
> updated as your system TZ is updated.

Then Org shall know what was local time! Without being specified in
the time stamp, it has to be specified somewhere, as computer can't
know at which time zone was it specified.

> The timestamps that should be tied to specific time zone will specify
> that required time zone and will thus remain functional.

That is clear.

> > The representation of the timestamps is the easy part. It is the
> > management, display, calculations, etc where the complications
> > arise. From looking at the supported time related functions in Emacs,
> > while most of the key ones do have support for passing in time zone
> > data, there seems little (if any) code to support the lookup and
> > retrieval of time zone data - in particular, ability to lookup time zone
> > data for a specific date, not just a location.
> 
> But why do we need any time zone data? All we need to converting from
> and to internal Emacs' time representation supplying the correct time
> zone to it.

Converting alone shall be easy, but that does not resolve the
problem. 

You need to review practical examples as they are already listed in
this thread by various people.

Time zones are important for people who work with different time
zones, and for those who share headings and Org files on the planet.

They are not important for people who are static in one city, who do
not travel and do not share Org files with others.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15 14:07           ` Ihor Radchenko
@ 2023-01-15 20:43             ` Tim Cross
  2023-01-16  5:20               ` Tom Gillespie
  2023-01-16 13:27               ` Ihor Radchenko
  0 siblings, 2 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-15 20:43 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Max Nikulin, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Tim Cross <theophilusx@gmail.com> writes:
>
>> Unfortunately, the common abbreviated forms like EST, AEST etc are
>> inconsistent here. Some places will have a standard and a daylight
>> savings type i.e. AEST and AEDT, while others will have just AEST. TO
>> make it worse, two locations with the same time zone offset my use
>> different versions i.e. Australia/Melbourn is AEST (+10/+11) and
>> Australia/Sydney is AEST (+10) and AEDT (+11) and Australia/Brisbane is
>> just AEST (+10). If everywhere which has daylight savings ensured they
>> used a different abbreviation for daylight saving and non-daylight
>> saving times, life would be easier, but they don't). Then of course
>> there are many countries which don't have a symbolic letter abbreviation
>> i.e. just have e.g -05 as their abbreviated TZ name.
>>
>> It is this and other related reasons why just relying on Emacs' internal
>> API for times and dates is not sufficient. The abbreviated times have
>> ambiguity and the full timezone specification is cumbersome and
>> ugly. Even worse is that issue won't be shown up as failures - you will
>> just silently get wrong results.  
>
> So, basically we may need a way to (1) identify ambiguous TZ
> specifications; (2) signal to user about potential issues.
>
> Note that these are also optional features we may implement any time
> once we have basic timezone support.
>
> For (2) we may use something similar to `world-clock' - display user
> timestamp at point for different time zones. Maybe via eldoc.


If the timestamp only contains the abbreviated name e.g. AEST, then
there is no automatic way to disambiguate - best we could
do is issue a warning. The abbreviated TZ name, unlike the full TZ name,
is really just a shorthand for the time offset from UTC at a specific
point in time. The full TZ name on the other hand states not only the
UTC offset, but also the TZ rules (and with things like the IANA TZ
database, the specific TZ rules in place at the point in time that
timestamp represents). This is essentially Max's main point - if
timestamps for the future have the full TZ name, then we can manage
things like changes in TZ database rules which occur after creation of
the timestamp or adjusting timestamps (for scheduled tasks) based on
changes in location etc). This would not be possible with abbreviated TZ
or just UTC offsets.

As an example, I'm in Australia/Brisbane TZ and I create a timestamp. If
it only has the AEST TZ info, when I travel to Australia/Melbourne org
would not be able to identify I'm in a TZ with an offset of +1100 rather
than +1000 because both use AEST (for NSW it likely would work as NSW
uses AEDT during daylight savings time). However, if the TZ was full
name i.e. Australian/Brisbane, then it does know and can adjust because
my local TZ has changed to Australia/Melbourne. 

So I guess the timestamp format and the code which manages them will
need the ability to use the full TZ name and not just the abbreviated
form (and I guess an option to allow the user to select). In fact, we
probably need a way to select between abbreviated/full dynamically as
well as you might use the different TZ types as a way to flag which
timestamps you want to adjust due to TZ changes (either in TZ db or in
user location) and those you don't want changed.

I also note a comment from an earlier thread regarding timestamps and
historical changes in tz info. I don't think this is an issue.  As far
as I know, past TZ rules/information rarely, if ever, change. It is only
with respect to future dates it is a problem and I doubt there is much
that can be done. For example Postgres recognises that a future
timestamp may become incorrect due to changes in TZ rules post creation
of the timestamp, but they specifically state they don't handle that
situation and that their model has an implicit assumption that the TZ
rules associated with a TZ don't change. In other words, from their
perspectrive, you would have to have a different process which monitors
TZ database information and when it changes, examine your db of
timestamps for ones which have been affected and adjust accordingly
(assuming it matters enough of course). I think org could eventually
reach a middle ground - if a future timestamp has the full tz name, then
changes can be applied, but if not they cannot and leave it to the user
to decide which is used. 


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FR] Allow end date and max repeat count for timestamps with repeaters (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)
  2023-01-15 13:45                 ` Ihor Radchenko
@ 2023-01-15 23:49                   ` Samuel Wales
  2023-01-15 23:53                     ` Samuel Wales
  2023-01-16 13:01                     ` Ihor Radchenko
  0 siblings, 2 replies; 330+ messages in thread
From: Samuel Wales @ 2023-01-15 23:49 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Russell Adams, emacs-orgmode

On 1/15/23, Ihor Radchenko <yantar92@posteo.net> wrote:
> My proposal is as little new syntax as I was able to come up with.

i kind of like it actually.  :]

but i just wanted to bring up the issue of 1] the possibility of
drawing a line in the sand at some point wrt creeping syntax [even if
not in tses for repeaters], [in principle in tses if tz complexity
turns out to demand more user specification etc.], and 2] 3rd party
and personal code that ... who knows what parsing lurks.  unintended
consequences and all that.

i checked my very old own code and indeed i'm not trying to get the
repeater with strict re character group, but in principle i can
imagine code by others could have.

>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FR] Allow end date and max repeat count for timestamps with repeaters (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)
  2023-01-15 23:49                   ` Samuel Wales
@ 2023-01-15 23:53                     ` Samuel Wales
  2023-01-16 13:01                     ` Ihor Radchenko
  1 sibling, 0 replies; 330+ messages in thread
From: Samuel Wales @ 2023-01-15 23:53 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Russell Adams, emacs-orgmode

to be clear, i won't object to that syntax, as i think it is as
intuitive as anything else in tses already, but do have the concerns i
raised in general.


On 1/15/23, Samuel Wales <samologist@gmail.com> wrote:
> On 1/15/23, Ihor Radchenko <yantar92@posteo.net> wrote:
>> My proposal is as little new syntax as I was able to come up with.
>
> i kind of like it actually.  :]
>
> but i just wanted to bring up the issue of 1] the possibility of
> drawing a line in the sand at some point wrt creeping syntax [even if
> not in tses for repeaters], [in principle in tses if tz complexity
> turns out to demand more user specification etc.], and 2] 3rd party
> and personal code that ... who knows what parsing lurks.  unintended
> consequences and all that.
>
> i checked my very old own code and indeed i'm not trying to get the
> repeater with strict re character group, but in principle i can
> imagine code by others could have.
>
>>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at <https://orgmode.org/>.
>> Support Org development at <https://liberapay.com/org-mode>,
>> or support my work at <https://liberapay.com/yantar92>
>>
>
>
> --
> The Kafka Pandemic
>
> A blog about science, health, human rights, and misopathy:
> https://thekafkapandemic.blogspot.com
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15 19:14           ` Jean Louis
@ 2023-01-16  4:20             ` Max Nikulin
  0 siblings, 0 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-16  4:20 UTC (permalink / raw)
  To: emacs-orgmode

On 16/01/2023 02:14, Jean Louis wrote:
> 
> As PostgreSQL type TIMESTAMP WITH TIME ZONE is stored with underlying
> UTC time, so should be Org times also be calculated with underlying
> UTC times.

Org currently can properly handle the following case:

Let's assume that current date is 2022-07-01. A user living in Mexico 
City schedules a local event at 2023-07-01 16:00 (local time, 
America/Mexico_City time zone). That day the region had DST active, so
current time at the moment of appointment creation has the form 
2022-07-01 16:00:00 CDT -0500.

Since that date it was decided to cancel DST transitions, so currently 
(2023-01-16) planned event time is not CDT -0500 but

TZ=America/Mexico_City date -d '2023-07-01 16:00' '+%F %T %Z %z'
2023-07-01 16:00:00 CST -0600

Agenda in Org has no problem as soon as tzdata is up to date.

As a PosgreSQL expert, could you, please, explain how to handle it in 
Postgres?

1. Downgrade tzdata to 2022e version or older, restart Postgres
2. Create a suitable table
3. Store "2023-07-01 16:00" America/Mexico_City timestamp using column 
types you find appropriate for such case
4. Update tzdata to 2022f version or newer, restart Postgres
5. Check that the event is still scheduled at 16:00 in Mexico City

I am interested in the table schema, insert and select commands.

To check timezone data you may use

     zdump  -v America/Mexico_City

Feel free to take another example of tzdata change instead of
https://github.com/eggert/tz/commit/2050724fa1144bacb0d35c7cd9b862da858406c4
that I found it in /usr/share/doc/tzdata/changelog.Debian.gz

I do not want a regression in Org due to a feature that is intended to 
improve timestamp handling. I see the point in the Postgres wiki 
recommendations, but I see their limitations as well. I do not feel that 
time offset and absence of DST can be considered as a settled state for 
the timezone I live in.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 11:18   ` Ihor Radchenko
  2023-01-14 11:26     ` Daryl Manning
  2023-01-14 13:03     ` Tim Cross
@ 2023-01-16  5:01     ` Tom Gillespie
  2023-01-16 12:31       ` Ihor Radchenko
  2 siblings, 1 reply; 330+ messages in thread
From: Tom Gillespie @ 2023-01-16  5:01 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Ihor Radchenko

> In anticipation to add time zones in future, I have added the following
> to the Org timestamp spec (see
> https://orgmode.org/worg/org-syntax.html#Timestamps):
>
> DATE TIME REPEATER-OR-DELAY
>
> TIME (optional)
> An instance of the pattern H:MMREST where H represents a one to two digit number (and can start with 0), and M represents a single digit. REST can contain anything but \n or closing bracket.
>
> Note that REST imply that almost arbitrary suffix can be in TIME without
> braking the existing Org timestamp parsing code.

I'm not sure how I feel about the REST in the grammar, I think it is a
reasonable approach but need to double check. I'm worried that there
can be some nasty interactions with REPEATER-OR-DELAY syntax, but that
may not actually be an issue.

I will note that this doesn't address the issue of syntax for
historical and future dates. For historical dates those almost always
require significant additional metadata to compensate for things like
the julian/gregorian calendar switchover etc. for future dates we may
want to go ahead and specify something beyond YYYY-.

I'm less concerned about the rest of the issues beyond the fact that
adding syntactic support for timezones seems to have opened up
countless usability and bad assumption issues that have been mentioned
elsewhere in the thread.

So, I think the syntax may be ok, but as written I think there can be
quite nasty interactions with REPEATER-OR-DELAY (not to mention what
happens if a delay tries to track across a change in timezones).

Best,
Tom


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15 20:43             ` Tim Cross
@ 2023-01-16  5:20               ` Tom Gillespie
  2023-01-16 13:29                 ` Ihor Radchenko
  2023-01-16 13:27               ` Ihor Radchenko
  1 sibling, 1 reply; 330+ messages in thread
From: Tom Gillespie @ 2023-01-16  5:20 UTC (permalink / raw)
  To: Tim Cross; +Cc: Ihor Radchenko, Max Nikulin, emacs-orgmode

> So I guess the timestamp format and the code which manages them will
> need the ability to use the full TZ name and not just the abbreviated
> form (and I guess an option to allow the user to select). In fact, we
> probably need a way to select between abbreviated/full dynamically as
> well as you might use the different TZ types as a way to flag which
> timestamps you want to adjust due to TZ changes (either in TZ db or in
> user location) and those you don't want changed.

I think the only sane way to do this is to require timezone abbreviations
/expansions to be defined in the file itself and never in an init.el there is
simply too much ambiguity and if the information is lost we are out of luck.

Of course then the question comes whether we can use something like
#+tzinfo: US/Central CT
#+tzoff: CST -06:00
#+tzoff: CDT -05:00
I don't think it is wise to allow users to map #+tzinfo: US/Central CST
because that will produce surprising and results when US/Central
changes to DST. Ugh, what a mess.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15 19:10         ` Jean Louis
@ 2023-01-16 11:21           ` Ihor Radchenko
  2023-01-16 11:30             ` Daryl Manning
  2023-01-17 15:24             ` Jean Louis
  0 siblings, 2 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 11:21 UTC (permalink / raw)
  To: Jean Louis; +Cc: Tim Cross, Daryl Manning, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

> * Ihor Radchenko <yantar92@posteo.net> [2023-01-14 16:23]:
>> But why do we need any time zone data? All we need to converting from
>> and to internal Emacs' time representation supplying the correct time
>> zone to it.
>
> When Org file is very personal and location centric, then there is no
> need for it.
>
> When Org file has assigned, shared tasks, and is related to other
> people in various locations over the world, then it becomes important.

Sorry, I think you misunderstood what I am saying here.

I was referring to a need for Org code to retrieve some kind of
timezone-specific data other than converting timestamps with time zone to
and back from the internal time representation.

In another message, I also mentioned an idea of specifying time zone
globally or per file. Other suggestion was per-heading specification. In
addition to time zone being specified directly inside the timestamp.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15 20:43         ` Jean Louis
@ 2023-01-16 11:25           ` Ihor Radchenko
  2023-01-17 15:19             ` Jean Louis
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 11:25 UTC (permalink / raw)
  To: Jean Louis; +Cc: Tim Cross, Daryl Manning, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

>> I am not sure what is the problem.
>> The timestamps that should stay in local time will be automatically
>> updated as your system TZ is updated.
>
> Then Org shall know what was local time! Without being specified in
> the time stamp, it has to be specified somewhere, as computer can't
> know at which time zone was it specified.

We need nothing to use current time zone. And we already do it.

System clock knows the current time zone. Emacs has an ability to
determine current time zone. See `current-time-zone'. This works
automatically (and already) because we use `encode-time'.

> You need to review practical examples as they are already listed in
> this thread by various people.

Indeed. This is the whole point of this discussion. Note my replies with
updated ideas. So far, I do not see a need to get some extra information
about time zones though. If you can, please correct me in the relevant
branches of this thread.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 11:21           ` Ihor Radchenko
@ 2023-01-16 11:30             ` Daryl Manning
  2023-01-16 11:39               ` Ihor Radchenko
  2023-01-16 20:25               ` Tim Cross
  2023-01-17 15:24             ` Jean Louis
  1 sibling, 2 replies; 330+ messages in thread
From: Daryl Manning @ 2023-01-16 11:30 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]

I think timezone you're in should be declared globally, surely?  And then
defined in the timestamp?

The use cases for per file or even per-heading tz specifying seems very low
imho (and introducing a lot more complexity.).

Daryl.

On Mon, Jan 16, 2023 at 6:20 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> Jean Louis <bugs@gnu.support> writes:
>
> > * Ihor Radchenko <yantar92@posteo.net> [2023-01-14 16:23]:
> >> But why do we need any time zone data? All we need to converting from
> >> and to internal Emacs' time representation supplying the correct time
> >> zone to it.
> >
> > When Org file is very personal and location centric, then there is no
> > need for it.
> >
> > When Org file has assigned, shared tasks, and is related to other
> > people in various locations over the world, then it becomes important.
>
> Sorry, I think you misunderstood what I am saying here.
>
> I was referring to a need for Org code to retrieve some kind of
> timezone-specific data other than converting timestamps with time zone to
> and back from the internal time representation.
>
> In another message, I also mentioned an idea of specifying time zone
> globally or per file. Other suggestion was per-heading specification. In
> addition to time zone being specified directly inside the timestamp.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 2334 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 11:30             ` Daryl Manning
@ 2023-01-16 11:39               ` Ihor Radchenko
  2023-01-16 15:43                 ` Daryl Manning
  2023-01-16 20:25               ` Tim Cross
  1 sibling, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 11:39 UTC (permalink / raw)
  To: Daryl Manning; +Cc: emacs-orgmode

Daryl Manning <daryl@wakatara.com> writes:

> I think timezone you're in should be declared globally, surely?  And then
> defined in the timestamp?

It is always defined globally on OS level. In POSIX-complaint OSes, it is
TZ. Emacs obeys POSIX and time zone settings in other OSes. We don't
need anything special for it.

As for time zone in timestamps - it must be optional. Timestamps with
time zone will use that time zone. Timestamps without time zone will use
"default" time zone - be it OS time zone or whatever custom time zone
setting we come up with in future. This "default" time zone approach is
both useful for things like "brush teeth in 10pm in the evening" and
also, more importantly, for backwards compatibility.

> The use cases for per file or even per-heading tz specifying seems very low
> imho (and introducing a lot more complexity.).

Sure. As I mentioned in another message, not having these features should
not stop us from merging whatever working time zone code we can come up
with. They will be nice to have though.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16  5:01     ` Tom Gillespie
@ 2023-01-16 12:31       ` Ihor Radchenko
  2023-01-16 20:32         ` Tim Cross
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 12:31 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: emacs-orgmode

Tom Gillespie <tgbugs@gmail.com> writes:

>> Note that REST imply that almost arbitrary suffix can be in TIME without
>> braking the existing Org timestamp parsing code.
>
> I'm not sure how I feel about the REST in the grammar, I think it is a
> reasonable approach but need to double check. I'm worried that there
> can be some nasty interactions with REPEATER-OR-DELAY syntax, but that
> may not actually be an issue.

The existing code uses `org-ts-regexp-both' and `org-ts-regexp0' for
analysis. + `org-element-timestamp-parser' that is using Elisp logic.

And these requirements are pretty lax. The actual parsing just requires

YYYY-MM-DD [day] XX:XX[-XX:XX][optional string containing anything but "\n]>"]

with repeater and warning located anywhere after the required
date/day/time components.

date, repeater and warning periods do not have to contain " " afterwards
and thus can have arbitrary misc data. This feature is used by
org-habit, attaching things like /3w after the repeater.

We have a lot of forward-compatibility in timestamps :)

> I will note that this doesn't address the issue of syntax for
> historical and future dates. For historical dates those almost always
> require significant additional metadata to compensate for things like
> the julian/gregorian calendar switchover etc. for future dates we may
> want to go ahead and specify something beyond YYYY-.

This is somewhat orthogonal to time zones.

I am not sure if julian/gregorian is handled by system time libraries.
It should, no?

As for years BC, <-0001-...> will be a breaking change. But I do not
think that we need to really worry about this. Not unless we actually
get feature request. What is the practical application?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FR] Allow end date and max repeat count for timestamps with repeaters (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)
  2023-01-15 23:49                   ` Samuel Wales
  2023-01-15 23:53                     ` Samuel Wales
@ 2023-01-16 13:01                     ` Ihor Radchenko
  1 sibling, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 13:01 UTC (permalink / raw)
  To: Samuel Wales; +Cc: Russell Adams, emacs-orgmode

Samuel Wales <samologist@gmail.com> writes:

> but i just wanted to bring up the issue of 1] the possibility of
> drawing a line in the sand at some point wrt creeping syntax [even if
> not in tses for repeaters], [in principle in tses if tz complexity
> turns out to demand more user specification etc.], and 2] 3rd party
> and personal code that ... who knows what parsing lurks.  unintended
> consequences and all that.
>
> i checked my very old own code and indeed i'm not trying to get the
> repeater with strict re character group, but in principle i can
> imagine code by others could have.

Well. I'd say that repeat count has been requested enough to strongly
consider adding it. I guess an alternative could be setting a heading
property to limit the number of repetitions.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15 19:52                     ` Jean Louis
@ 2023-01-16 13:11                       ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 13:11 UTC (permalink / raw)
  To: Jean Louis; +Cc: tomas, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

> * Ihor Radchenko <yantar92@posteo.net> [2023-01-14 20:08]:
>> > When you have appointments with people in totally diverse time zones,
>> > perhaps dates tend to be more fixed wrt UTC.
>> 
>> AFAIK, people don't usually bother.
>
> Can't agree to that, we who do bother will simply find different
> solutions but Org, like I have developed it for myself or other CRM
> systems where all time issues are solved fundamentally on the database
> level.

I think you misunderstood my statement here.

"People don't bother" does not make life easier for us.
I was replying to an assertion that it is common for meeting times to be
expressed in non-ambiguous UTC+XX offsets. I gave an example that it is
not the case - some meetings are, in fact, scheduled in local, tricky
time zones. We have to account for those.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15 20:28                   ` Jean Louis
@ 2023-01-16 13:17                     ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 13:17 UTC (permalink / raw)
  To: Jean Louis; +Cc: Max Nikulin, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

> In the context of Org files, that would mean that there must exist
> function which would convert time zone timestamps into local time zone
> for proper representation.
>
> Only with such functions problems are gone.
>
> Without such function to convert time zones in different time zone,
> user will see time zone from Brazil and will run into difficulties.

This is not a problem. We already have `org-time-stamp-custom-formats'
that will use current time zone.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15 19:26                   ` Jean Louis
@ 2023-01-16 13:20                     ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 13:20 UTC (permalink / raw)
  To: Jean Louis; +Cc: Tim Cross, Max Nikulin, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

> One could think for Org to simply become able to designate time zone
> somewhere, be it generally for Org file or/and specific heading, or/and
> specific timestamp. 
>
> Then implement function to transform time to UTC, and then use
> libraries or Emacs to transform UTC to designated time zone.

We already transform timestamps into internal time representation via
`encode-time' (for the most part, at least). It is an equivalent to
transforming to UTC. The internal representation can be later
transformed back via `decode-time' with appropriate target ZONE
parameter.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15 20:43             ` Tim Cross
  2023-01-16  5:20               ` Tom Gillespie
@ 2023-01-16 13:27               ` Ihor Radchenko
  1 sibling, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 13:27 UTC (permalink / raw)
  To: Tim Cross; +Cc: Max Nikulin, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> If the timestamp only contains the abbreviated name e.g. AEST, then
> there is no automatic way to disambiguate - best we could
> do is issue a warning. The abbreviated TZ name, unlike the full TZ name,
> is really just a shorthand for the time offset from UTC at a specific
> point in time. The full TZ name on the other hand states not only the
> UTC offset, but also the TZ rules (and with things like the IANA TZ
> database, the specific TZ rules in place at the point in time that
> timestamp represents). This is essentially Max's main point - if
> timestamps for the future have the full TZ name, then we can manage
> things like changes in TZ database rules which occur after creation of
> the timestamp or adjusting timestamps (for scheduled tasks) based on
> changes in location etc). This would not be possible with abbreviated TZ
> or just UTC offsets.

Sure. That's what I proposed by

<2023-01-16 Mon 12:00@Australia/Melbourne>

But we may as well allow UTC offsets there

<2023-01-16 Mon 12:00+0200>

whichever users prefer to use in their use case.

Both the variants may be preferred depending on the purpose. The first
is good when we need to conform to local time, including all the
possible changes in TZ rules. The second is good when we, say, want to
schedule something "102000 _actual_ hours from the beginning of the
experiment; don't care about what government may decide about
winter/summer time in future"

> So I guess the timestamp format and the code which manages them will
> need the ability to use the full TZ name and not just the abbreviated
> form (and I guess an option to allow the user to select). In fact, we
> probably need a way to select between abbreviated/full dynamically as
> well as you might use the different TZ types as a way to flag which
> timestamps you want to adjust due to TZ changes (either in TZ db or in
> user location) and those you don't want changed.

Sure. We should get it for free because both GMT+8 and Asia/Singapore
are the valid TZ values. Both supported by Emacs' `encode-time'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16  5:20               ` Tom Gillespie
@ 2023-01-16 13:29                 ` Ihor Radchenko
  2023-01-16 17:30                   ` Tom Gillespie
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 13:29 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: Tim Cross, Max Nikulin, emacs-orgmode

Tom Gillespie <tgbugs@gmail.com> writes:

>> So I guess the timestamp format and the code which manages them will
>> need the ability to use the full TZ name and not just the abbreviated
>> form (and I guess an option to allow the user to select). In fact, we
>> probably need a way to select between abbreviated/full dynamically as
>> well as you might use the different TZ types as a way to flag which
>> timestamps you want to adjust due to TZ changes (either in TZ db or in
>> user location) and those you don't want changed.
>
> I think the only sane way to do this is to require timezone abbreviations
> /expansions to be defined in the file itself and never in an init.el there is
> simply too much ambiguity and if the information is lost we are out of luck.

I strongly disagree. I'd prefer to allow only internationally recognized
time zone format. Let's not make life harder for Org file parsers.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 11:39               ` Ihor Radchenko
@ 2023-01-16 15:43                 ` Daryl Manning
  2023-01-16 19:07                   ` Ihor Radchenko
  2023-01-19 17:33                   ` Alexander Adolf
  0 siblings, 2 replies; 330+ messages in thread
From: Daryl Manning @ 2023-01-16 15:43 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1859 bytes --]

I agree... TZ is optionally defined in a timestamp otherwise understood to
be "local".

I'd just be excited to have us run through the basic use cases and then see
some more "tricky" ones. I imagine there are things we'd just have to
say... too tricky for (eg. flight takes off in one TZ and range allows it
to land in timezone... stuff like that might be tricky.).

So, is the TS syntax you've described accepted and canonical now with
org-mode?

Daryl.



On Mon, Jan 16, 2023 at 6:39 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> Daryl Manning <daryl@wakatara.com> writes:
>
> > I think timezone you're in should be declared globally, surely?  And then
> > defined in the timestamp?
>
> It is always defined globally on OS level. In POSIX-complaint OSes, it is
> TZ. Emacs obeys POSIX and time zone settings in other OSes. We don't
> need anything special for it.
>
> As for time zone in timestamps - it must be optional. Timestamps with
> time zone will use that time zone. Timestamps without time zone will use
> "default" time zone - be it OS time zone or whatever custom time zone
> setting we come up with in future. This "default" time zone approach is
> both useful for things like "brush teeth in 10pm in the evening" and
> also, more importantly, for backwards compatibility.
>
> > The use cases for per file or even per-heading tz specifying seems very
> low
> > imho (and introducing a lot more complexity.).
>
> Sure. As I mentioned in another message, not having these features should
> not stop us from merging whatever working time zone code we can come up
> with. They will be nice to have though.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 2743 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15 13:41           ` Ihor Radchenko
@ 2023-01-16 16:43             ` Max Nikulin
  2023-01-16 18:37               ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-16 16:43 UTC (permalink / raw)
  To: emacs-orgmode

On 15/01/2023 20:41, Ihor Radchenko wrote:
> Max Nikulin writes:
>> On 14/01/2023 18:42, Ihor Radchenko wrote:
>>>
>>> <2023-01-14 Sat 18:22@Asia/Singapore>  (SGD and similar abbreviations are often ambiguous)
>>
>> Such format is ambiguous for timezones with DST around backward time
>> jump. Before/after time transition should be specified in addition, e.g.
>> by combining identifier and offset or some way to state namely before or
>> after.
> 
> Are you referring to one hour in year when the clock is moved one hour
> forward?
> 
> <2023-10-29 Sun 3:00@+DST/Europe/Berlin> -> (+1 minute)
> <2023-10-29 Sun 2:01@-DST/Europe/Berlin>
> 
> I, however, do not feel like we need this +/-DST special notation.
> Chances that one needs a timestamp in this specific hour are slim. At
> the end, countries deliberately choose the time transition to not
> interfere with business activity.

Yes, I do not mind to be able to represent 2023-10-29 Sun 2:01 before 
and after transition in the Europe/Berlin timezone. Notice that Python 
developers chose "fold" instead of "DST" for argument and field name:
https://peps.python.org/pep-0495/
PEP 495 – Local Time Disambiguation

We should have this in mind, but I agree the priority is not highest one.

> I just tried:
> 
> (time-subtract
> (encode-time 0 1 3 29 10 2023 nil -1 ":Europe/Berlin")
> (encode-time 0 59 2 29 10 2023 nil -1 ":Europe/Berlin"))

Pass list to `encode-time', not separate values in Emacs >= 27, since 
this case DST is -1 (guess) it is not important, but generally the value 
is ignored. It is a pitfall in API.

> (see https://www.timeanddate.com/time/zone/germany/berlin)

You can inspect your local database
     zdump -v Europe/Berlin

> and it looks like the expected return value should be 1 hour 2 minutes
> (3720), but it is not, on my system.

it is assumed that you should explicitly specify DST to get another 
branch (but at first you should determine somehow at which side DST 
should be applied):

(let* ((tz "Europe/Berlin")
        (t1 (encode-time `(0 1 3 29 10 2023 nil nil ,tz)))
        (t2 (encode-time `(0 59 2 29 10 2023 nil t ,tz))))
   (list
    (format-time-string "%F %T %z %Z" t1 tz)
    (format-time-string "%F %T %z %Z" t2 tz)
    (time-subtract t1 t2)))
("2023-10-29 03:01:00 +0100 CET" "2023-10-29 02:59:00 +0200 CEST" 3720)

Actually behavior is more funny, but I need more time to investigate it 
more close.

The real problem with libc is that TZ DB contains time transitions 
preserving DST value and DST argument of `encode-time' becomes useless:

Europe/Kyiv  Sat Jun 30 21:59:59 1990 UT = Sun Jul  1 01:59:59 1990 MSD 
isdst=1 gmtoff=14400
Europe/Kyiv  Sat Jun 30 22:00:00 1990 UT = Sun Jul  1 01:00:00 1990 EEST 
isdst=1 gmtoff=10800

zdump -v Africa/Juba
...
Africa/Juba  Sun Jan 31 20:59:59 2021 UT = Sun Jan 31 23:59:59 2021 EAT 
isdst=0 gmtoff=10800
Africa/Juba  Sun Jan 31 21:00:00 2021 UT = Sun Jan 31 23:00:00 2021 CAT 
isdst=0 gmtoff=7200

>>> <2023-01-14 Sat 18:22@+08>
>>
>> May become incorrect for future events due to updates of timezone database.
> 
> Emm. No? +8 is offset from UTC. It will not be affected by anything.
> Or are you referring to scenarios when user actually wants to specify the
> timestamp for specific country/city? Then the TZ variant should be used
> instead.

Certainly events are usually associated with some area. I think, users 
will prefer concise +0800 notation to full timezone ID like 
Asia/Singapore and will get unexpected results sometimes. Manual should 
stress that fixing time offset is not a bright idea for planning.

> What I am essentially proposing in these examples is allowing:
> 1. TZ format as described in https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html

Some formats may be confusing for users, e.g. TZ=GMT+5 actually means 
-0500 offset.

> 2. ISO 8601 format https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators

I do not see IANA identifiers here. Moreover currently there is no API 
to get list of IANA identifiers. On windows additional mapping may be 
required:
https://unicode-org.github.io/cldr-staging/charts/37/supplemental/zone_tzid.html

I do not mind to fix timestamps in past by adding offsets like +0100. 
For planning timezone identifiers should be strongly preferred unless 
time is really fixed in respect to UTC.




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 13:29                 ` Ihor Radchenko
@ 2023-01-16 17:30                   ` Tom Gillespie
  2023-01-16 17:53                     ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Tom Gillespie @ 2023-01-16 17:30 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Tim Cross, Max Nikulin, emacs-orgmode

> I strongly disagree. I'd prefer to allow only internationally recognized
> time zone format. Let's not make life harder for Org file parsers.

So offsets and tz database names but no time zone abbreviations?

That seems reasonable since there isn't a sane way to handle the
timezone with dst vs abbreviation for an offset, so better to force
only US/Central aka America/Chicago and then -06:00 and -05:00
if users want CST/CDT to avoid any ambiguity?


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 17:30                   ` Tom Gillespie
@ 2023-01-16 17:53                     ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 17:53 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: Tim Cross, Max Nikulin, emacs-orgmode

Tom Gillespie <tgbugs@gmail.com> writes:

>> I strongly disagree. I'd prefer to allow only internationally recognized
>> time zone format. Let's not make life harder for Org file parsers.
>
> So offsets and tz database names but no time zone abbreviations?
>
> That seems reasonable since there isn't a sane way to handle the
> timezone with dst vs abbreviation for an offset, so better to force
> only US/Central aka America/Chicago and then -06:00 and -05:00
> if users want CST/CDT to avoid any ambiguity?

No. Let's allow anything that can be understood by `encode-time' (or TZ
variable in other words). And also recommend using America/Chicago-like
and direct offsets in the manual. Abbreviations should be supported, but
not advised.

We may also later provide a linter to warn about ambiguous abbreviations
and times.

Basically, there is literally no way we avoid ambiguous timestamps, yet
keeping the required flexibility. No matter what we try. The best we can
do is support everything, recommend more reliable practices in the
manual, and warn about possible problems.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 16:43             ` Max Nikulin
@ 2023-01-16 18:37               ` Ihor Radchenko
  2023-01-17 17:40                 ` Max Nikulin
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 18:37 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

>> Are you referring to one hour in year when the clock is moved one hour
>> forward?
>> 
>> <2023-10-29 Sun 3:00@+DST/Europe/Berlin> -> (+1 minute)
>> <2023-10-29 Sun 2:01@-DST/Europe/Berlin>
>> 
>> I, however, do not feel like we need this +/-DST special notation.
>> Chances that one needs a timestamp in this specific hour are slim. At
>> the end, countries deliberately choose the time transition to not
>> interfere with business activity.
>
> Yes, I do not mind to be able to represent 2023-10-29 Sun 2:01 before 
> and after transition in the Europe/Berlin timezone. Notice that Python 
> developers chose "fold" instead of "DST" for argument and field name:
> https://peps.python.org/pep-0495/
> PEP 495 – Local Time Disambiguation
>
> We should have this in mind, but I agree the priority is not highest one.

I think we could allow the "double zone" idea I mentioned in another
discussion branch:

<2023-10-29 Sun 3:00+0200@Europe/Berlin> -> (+1 minute)
<2023-10-29 Sun 2:01+0100@Europe/Berlin>

Because 2:01 will happen twice that day, it will also be possible to specify 

<2023-10-29 Sun 2:01+0200@Europe/Berlin>

I think it is more intuitive compared to DST/no DST.
And we do not even need to parse this scenario specially:

The variants of the TZ spec will be:

HH:MM@[^\n>\]]+
HH:MMZ
HH:MM[+-−][0-9]{2}\([0-9]{2}\)?
(note that I don't list times like 12:00+02:00 because it will interfere
with time range syntax 08:00-09:00 is a time range, but might also be
08:00-0900 time zone)

then, "@Europe/Berlin" in 2:01+0200@Europe/Berlin will be simply ignored
and we will use the explicit UTC offset.

>> I just tried:
>> 
>> (time-subtract
>> (encode-time 0 1 3 29 10 2023 nil -1 ":Europe/Berlin")
>> (encode-time 0 59 2 29 10 2023 nil -1 ":Europe/Berlin"))
>
> Pass list to `encode-time', not separate values in Emacs >= 27, since 
> this case DST is -1 (guess) it is not important, but generally the value 
> is ignored. It is a pitfall in API.

I see. This is not the only pitfall though.

I just discussed the same issue with Tecosaur, and he noted
that <2023-10-29 2:59@Europe/Berlin> is ambiguous because 2:59 occurs
twice during that day:

  2:59 -> 3:00 (DST -1 hour transition) -> 2:01 -> ... -> 2:59 -> 3:00 -> 3:01

The fact that `encode-time' chose 2:59 after the transition is
implementation detail.

To deal with such cases, we may provide org-lint checker that will
compare timestamps with t and nil DST parameter for `encode-time' and
warn if there is a difference.

(encode-time '(0 59 2 29 10 2023 nil -1 ":Europe/Berlin")) ; => (25917 44628)
(encode-time '(0 59 2 29 10 2023 nil t ":Europe/Berlin")) ; => (25917 44!628) (same)
(encode-time '(0 59 2 29 10 2023 nil nil ":Europe/Berlin")) ; => (25917 48!!228) (different)

(encode-time 0 59 2 29 10 2023 nil -1 ":Europe/Berlin") ; => (25917 48!!228)
(encode-time 0 59 2 29 10 2023 nil t ":Europe/Berlin") ; same
(encode-time 0 59 2 29 10 2023 nil nil ":Europe/Berlin") ; same

So, there is a gotcha with `encode-time' API, and we must use the list
argument. (This gotcha is described in the docstring, but in rather
cryptic way)

>>>> <2023-01-14 Sat 18:22@+08>
>>>
>>> May become incorrect for future events due to updates of timezone database.
>> 
>> Emm. No? +8 is offset from UTC. It will not be affected by anything.
>> Or are you referring to scenarios when user actually wants to specify the
>> timestamp for specific country/city? Then the TZ variant should be used
>> instead.
>
> Certainly events are usually associated with some area. I think, users 
> will prefer concise +0800 notation to full timezone ID like 
> Asia/Singapore and will get unexpected results sometimes. Manual should 
> stress that fixing time offset is not a bright idea for planning.

Sure. Having per-file/heading time zone settings will also help.

I don't think that people will mind _occasional_ timestamps having
Asia/Singapore. I'd personally prefer this kind of verbosity for
overseas remote events.

>> What I am essentially proposing in these examples is allowing:
>> 1. TZ format as described in https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
>
> Some formats may be confusing for users, e.g. TZ=GMT+5 actually means 
> -0500 offset.

Let's just recommend +-XXXX and @location in the manual. And mention
briefly that TZ format is supported in addition.

We might also provide an optional linter for GMT, if necessary.

>> 2. ISO 8601 format https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators
>
> I do not see IANA identifiers here. Moreover currently there is no API 
> to get list of IANA identifiers. On windows additional mapping may be 
> required:
> https://unicode-org.github.io/cldr-staging/charts/37/supplemental/zone_tzid.html
>
> I do not mind to fix timestamps in past by adding offsets like +0100. 
> For planning timezone identifiers should be strongly preferred unless 
> time is really fixed in respect to UTC.

Could you please elaborate? I don't fully understand what you are
referring to.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 15:43                 ` Daryl Manning
@ 2023-01-16 19:07                   ` Ihor Radchenko
  2023-01-16 19:22                     ` Robert Horn
                                       ` (2 more replies)
  2023-01-19 17:33                   ` Alexander Adolf
  1 sibling, 3 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 19:07 UTC (permalink / raw)
  To: Daryl Manning; +Cc: emacs-orgmode

Daryl Manning <daryl@wakatara.com> writes:

> I'd just be excited to have us run through the basic use cases and then see
> some more "tricky" ones. I imagine there are things we'd just have to
> say... too tricky for (eg. flight takes off in one TZ and range allows it
> to land in timezone... stuff like that might be tricky.).

https://www.youtube.com/watch?v=-5wpm-gesOY gives various examples.
To summarize:

1. Time (YYYY-MM-DD HH:MM) not continuous and may change arbitrarily at
   certain times a year or in future or in the past:
   - DST transitions are not stable and change from year to year
     according to strange rules that may involve Julian dates or
     counting weekdays
   - DST transition rules may change over time
   - The new year day itself is not necessarily fixed (England
   - Julian/Gregorian transitions happened at different times in
     different countries

2. There might be arbitrary time gaps due to time transition, including
   time overlaps with the same time of the day happening multiple time a
   day:
   - One hour back during DST transition (northern and southern
     hemispheres do the transitions in opposite directions)
   - Multiple days skipped (Samoa skips a whole day during DST
     transition)
   - Great Britain used 2 hours DST offset during WWII
   - Julian/Gregorian calendar transitions in the past

3. We cannot assume that the same geographical area has fixed time zone
   even at given point of time:
   - Palestinian/Israeli people follow different time zones in the
     contested territories

4. Great Britain had new year on March 25 until 16th century
   (March 24, 1000 -> (+1 day) March 25, 1001)

5. Leap seconds! 23:59:59 -> 23:59:60 -> 00:00:00, according to
   astronomical Earth observations

> So, is the TS syntax you've described accepted and canonical now with
> org-mode?

We are still discussing it.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 19:07                   ` Ihor Radchenko
@ 2023-01-16 19:22                     ` Robert Horn
  2023-01-16 19:41                       ` Ihor Radchenko
  2023-01-17 15:37                     ` Jean Louis
  2023-01-17 17:28                     ` Max Nikulin
  2 siblings, 1 reply; 330+ messages in thread
From: Robert Horn @ 2023-01-16 19:22 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Daryl Manning, emacs-orgmode


Ihor Radchenko <yantar92@posteo.net> writes:

> https://www.youtube.com/watch?v=-5wpm-gesOY gives various examples.
> To summarize:
>
> 1. Time (YYYY-MM-DD HH:MM) not continuous and may change arbitrarily at
>    certain times a year or in future or in the past:
>    - DST transitions are not stable and change from year to year
>      according to strange rules that may involve Julian dates or
>      counting weekdays
>    - DST transition rules may change over time
>    - The new year day itself is not necessarily fixed (England
>    - Julian/Gregorian transitions happened at different times in
>      different countries
>

Note that as a result "time when it happened" has different rules than
"future time when it is scheduled".  There are lots of other times that are
scheduled as "future local time, subject to changing DST rules".  This
is particularly tricky for repeating times for regularly scheduled events.

> 5. Leap seconds! 23:59:59 -> 23:59:60 -> 00:00:00, according to
>    astronomical Earth observations
>

Fortunately, the most recent vote reached majority for eliminating leap
seconds, hopefully within 8 years.

-- 
Robert Horn
rjhorn@alum.mit.edu


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 19:22                     ` Robert Horn
@ 2023-01-16 19:41                       ` Ihor Radchenko
  2023-01-16 20:47                         ` Robert Horn
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-16 19:41 UTC (permalink / raw)
  To: rjhorn; +Cc: Daryl Manning, emacs-orgmode

Robert Horn <rjhorn@panix.com> writes:

>> 1. Time (YYYY-MM-DD HH:MM) not continuous and may change arbitrarily at
>>    certain times a year or in future or in the past:
>>    - DST transitions are not stable and change from year to year
>>      according to strange rules that may involve Julian dates or
>>      counting weekdays
>>    - DST transition rules may change over time
>>    - The new year day itself is not necessarily fixed (England
>>    - Julian/Gregorian transitions happened at different times in
>>      different countries
>
> Note that as a result "time when it happened" has different rules than
> "future time when it is scheduled".  There are lots of other times that are
> scheduled as "future local time, subject to changing DST rules".  This
> is particularly tricky for repeating times for regularly scheduled events.

Not really. Countries may change DST at any moment in future. Or decide
to switch calendars (consider countries near the day transition line).

And "past local time, according to the DST rules in effect at the time"
is also an option that might be useful in certain scenarios.

>> 5. Leap seconds! 23:59:59 -> 23:59:60 -> 00:00:00, according to
>>    astronomical Earth observations
>
> Fortunately, the most recent vote reached majority for eliminating leap
> seconds, hopefully within 8 years.

But we will have to keep supporting all the leap seconds that already
happened! So it does not really help all that much wrt timestamp
design.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 11:30             ` Daryl Manning
  2023-01-16 11:39               ` Ihor Radchenko
@ 2023-01-16 20:25               ` Tim Cross
  2023-01-17  9:07                 ` Ihor Radchenko
  1 sibling, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-16 20:25 UTC (permalink / raw)
  To: Daryl Manning; +Cc: Ihor Radchenko, emacs-orgmode

Daryl Manning <daryl@wakatara.com> writes:

> I think timezone you're in should be declared globally, surely?  And then defined in the timestamp?
>

Do you mean globally as in at the OS level or globally in org mode. If
the latter, I disagree. The OS has this information and there is no need
for org to repeat it (and possibly hav it wrong). I would go the other
direction and say that the TZ should only be defined in an org file i it
differs from the OS setting.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 12:31       ` Ihor Radchenko
@ 2023-01-16 20:32         ` Tim Cross
  2023-01-16 20:51           ` Tom Gillespie
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-16 20:32 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Tom Gillespie, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Tom Gillespie <tgbugs@gmail.com> writes:
>
>
>> I will note that this doesn't address the issue of syntax for
>> historical and future dates. For historical dates those almost always
>> require significant additional metadata to compensate for things like
>> the julian/gregorian calendar switchover etc. for future dates we may
>> want to go ahead and specify something beyond YYYY-.
>
> This is somewhat orthogonal to time zones.
>
> I am not sure if julian/gregorian is handled by system time libraries.
> It should, no?
>
> As for years BC, <-0001-...> will be a breaking change. But I do not
> think that we need to really worry about this. Not unless we actually
> get feature request. What is the practical application?

Given that the stated approach is to leverage off OS facilities in this
area, it probably should also be noted that some OSs don't handle
historical dates, especially BC ones, at all well. For example, some OS
use a 32 bit number to represent the date+time and can really only
handle dates between approx 1900 and 2038 (or around there - cannot
remember specific range). So with respect to timestamps and time related
calculations, we are limited by the capabilities of the least capable
supported OS.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 19:41                       ` Ihor Radchenko
@ 2023-01-16 20:47                         ` Robert Horn
  2023-01-16 21:02                           ` Tom Gillespie
                                             ` (4 more replies)
  0 siblings, 5 replies; 330+ messages in thread
From: Robert Horn @ 2023-01-16 20:47 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: rjhorn, Daryl Manning, emacs-orgmode


Ihor Radchenko <yantar92@posteo.net> writes:

> Robert Horn <rjhorn@panix.com> writes:
>
>>> 1. Time (YYYY-MM-DD HH:MM) not continuous and may change arbitrarily at
>>>    certain times a year or in future or in the past:
>>>    - DST transitions are not stable and change from year to year
>>>      according to strange rules that may involve Julian dates or
>>>      counting weekdays
>>>    - DST transition rules may change over time
>>>    - The new year day itself is not necessarily fixed (England
>>>    - Julian/Gregorian transitions happened at different times in
>>>      different countries
>>
>> Note that as a result "time when it happened" has different rules than
>> "future time when it is scheduled".  There are lots of other times that are
>> scheduled as "future local time, subject to changing DST rules".  This
>> is particularly tricky for repeating times for regularly scheduled events.
>
> Not really. Countries may change DST at any moment in future. Or decide
> to switch calendars (consider countries near the day transition line).
>
> And "past local time, according to the DST rules in effect at the time"
> is also an option that might be useful in certain scenarios.
>

The issue is clarity of the expected rules for the format.  If I
schedule a meeting for 10:05 DST, but the rules change so that it is not
DST at that location at that time in the future, what is the expected
interpretation?  It could be:

 a) the meeting should be at 10:05 ST, because the intent was to meet at
 10AM in the then local time.
 
 b) the meeting should be at 11:05 ST, because the time was chosen to
 correspond to a particular sun angle.

Getting the rules and explanation clear is the issue.  It's a mistake
that a great many people make with scheduling meetings.  Those two
behaviors need different encodings because they behave differently.

-- 
Robert Horn
rjhorn@alum.mit.edu


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 20:32         ` Tim Cross
@ 2023-01-16 20:51           ` Tom Gillespie
  2023-01-17  9:12             ` [FR] Allow BC years in timestamps (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Tom Gillespie @ 2023-01-16 20:51 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Ihor Radchenko, Tim Cross

> > As for years BC, <-0001-...> will be a breaking change. But I do not
> > think that we need to really worry about this. Not unless we actually
> > get feature request. What is the practical application?

Using org as a format for writing about history and being able to
reference dates in the past accurately and have the dates be
first class entities that can be parsed and checked etc.

The example in my head is a history professor who wants to
write about e.g. the collapse of the Roman republic and not
have to come up with their own time keeping system or force
any one who wants to work with referenced dates to do a bunch
of math to translate from a roman time system to a modern one.

> Given that the stated approach is to leverage off OS facilities in this
> area, it probably should also be noted that some OSs don't handle
> historical dates, especially BC ones, at all well. For example, some OS
> use a 32 bit number to represent the date+time and can really only
> handle dates between approx 1900 and 2038 (or around there - cannot
> remember specific range). So with respect to timestamps and time related
> calculations, we are limited by the capabilities of the least capable
> supported OS.

I'm mostly concerned about the syntactic features where org already
supports dates well outside the facilities of various operating systems.
I don't think that it is wise or practical for org-mode code to use
anything other than the os provided time keeping facilities right now,
but it is important to enable people who might want to do so. Org as
a format for documents has a wider range of use cases for dates and
times than Org as a life organizer and planner. At the same time those
wider use cases don't always need as much precision or ux considerations
because I don't think anyone using org right now is going to be early or
late to their meeting at [3023-01-16 Thu 12:00] (regardless of the timezone).
But org does tell me that it will be a Thursday! Best,
Tom


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 20:47                         ` Robert Horn
@ 2023-01-16 21:02                           ` Tom Gillespie
  2023-01-16 21:48                             ` Robert Horn
  2023-01-17  3:55                           ` Daryl Manning
                                             ` (3 subsequent siblings)
  4 siblings, 1 reply; 330+ messages in thread
From: Tom Gillespie @ 2023-01-16 21:02 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: rjhorn

> Getting the rules and explanation clear is the issue.  It's a mistake
> that a great many people make with scheduling meetings.  Those two
> behaviors need different encodings because they behave differently.

This is related to why I suggested splitting timezones and offsets into
two separate categories. I think we have to assume that the written
content of timestamps in an org file cannot/will-not be changed
automatically.

Therefore if the timezone is specified then the numbers will never
change, but the actual time might if the timezone spec changes.

If an offset is used then it will not account for changes due
to DST, but it will always remain stable, shuffling a meeting an hour
one way or the other at some points in the year, which is usually
undesirable compared to say, shuffling a meeting 1 hour in one
direction for people who are not in the defining timezone for the
duration of the mismatch between DST changes in different regions.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 21:02                           ` Tom Gillespie
@ 2023-01-16 21:48                             ` Robert Horn
  2023-01-17  8:53                               ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Robert Horn @ 2023-01-16 21:48 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: emacs-orgmode, rjhorn


Tom Gillespie <tgbugs@gmail.com> writes:

>> Getting the rules and explanation clear is the issue.  It's a mistake
>> that a great many people make with scheduling meetings.  Those two
>> behaviors need different encodings because they behave differently.
>
> This is related to why I suggested splitting timezones and offsets into
> two separate categories. I think we have to assume that the written
> content of timestamps in an org file cannot/will-not be changed
> automatically.
>

The solution that we used in an operational scheduling system was to
invent a new family of time zones, the "Then Local Time There".  So you
would schedule something like "10:05 TLT (NorthAmerica/New York)".  This
was the most commonly used scheduled time.  It's what most people mean
when they schedule something.  Then the scheduled time encoding did not
change, but the displayed time could.  It was displayed in a format that
met the needs of the users.  When you're dealing with people in many
locations you need to separate the concept of scheduled time in the org
file from the concept of time display in a format useful to the user.

Those who wanted astronomical or other relationships would usually
specify UTC or TAI.  They might use a fixed offset for UTC.  People who
are into the demands of TAI (e.g., orbital mechanics) generally don't
want to deal with the offsets or other issues that come up with UTC, so
they wanted TAI.

-- 
Robert Horn
rjhorn@alum.mit.edu


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 20:47                         ` Robert Horn
  2023-01-16 21:02                           ` Tom Gillespie
@ 2023-01-17  3:55                           ` Daryl Manning
  2023-01-17  8:22                             ` Tim Cross
  2023-01-17  8:45                           ` Ihor Radchenko
                                             ` (2 subsequent siblings)
  4 siblings, 1 reply; 330+ messages in thread
From: Daryl Manning @ 2023-01-17  3:55 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: rjhorn

[-- Attachment #1: Type: text/plain, Size: 3056 bytes --]

I'd argue that setting a specific datestamp  and time for DST would mean
that you expected to meet at that specific time and date as per DST. If the
clocks changed you'd be out of luck (that's where I'd argue you'd use a
non-specified timezone for a meeting that re-occurs at 10:05 regardless of
say PDT or PST).

But if this was an issue with a recurring meeting, then when the clocks
changed someone would be out an hour because they had specifically booked
with DST in mind (note: this is more useful than you think - being in
non-DST countries and having scheduled meetings in DST based countries, a
lot of cal applications get this wrong when what I actually want is for
that DST scheduled meeting to now be reflected in my calendar on the fact
they've switched to ST in their time zone - so shifted an hour.).

But I feel this is something that would be for people who need to take
advantage of this. And, more often than not, is a recurring meeting issue
when DST/ST changes occur.

Daryl.


On Tue, Jan 17, 2023 at 3:54 AM Robert Horn <rjhorn@panix.com> wrote:

>
> Ihor Radchenko <yantar92@posteo.net> writes:
>
> > Robert Horn <rjhorn@panix.com> writes:
> >
> >>> 1. Time (YYYY-MM-DD HH:MM) not continuous and may change arbitrarily at
> >>>    certain times a year or in future or in the past:
> >>>    - DST transitions are not stable and change from year to year
> >>>      according to strange rules that may involve Julian dates or
> >>>      counting weekdays
> >>>    - DST transition rules may change over time
> >>>    - The new year day itself is not necessarily fixed (England
> >>>    - Julian/Gregorian transitions happened at different times in
> >>>      different countries
> >>
> >> Note that as a result "time when it happened" has different rules than
> >> "future time when it is scheduled".  There are lots of other times that
> are
> >> scheduled as "future local time, subject to changing DST rules".  This
> >> is particularly tricky for repeating times for regularly scheduled
> events.
> >
> > Not really. Countries may change DST at any moment in future. Or decide
> > to switch calendars (consider countries near the day transition line).
> >
> > And "past local time, according to the DST rules in effect at the time"
> > is also an option that might be useful in certain scenarios.
> >
>
> The issue is clarity of the expected rules for the format.  If I
> schedule a meeting for 10:05 DST, but the rules change so that it is not
> DST at that location at that time in the future, what is the expected
> interpretation?  It could be:
>
>  a) the meeting should be at 10:05 ST, because the intent was to meet at
>  10AM in the then local time.
>
>  b) the meeting should be at 11:05 ST, because the time was chosen to
>  correspond to a particular sun angle.
>
> Getting the rules and explanation clear is the issue.  It's a mistake
> that a great many people make with scheduling meetings.  Those two
> behaviors need different encodings because they behave differently.
>
> --
> Robert Horn
> rjhorn@alum.mit.edu
>

[-- Attachment #2: Type: text/html, Size: 3996 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17  3:55                           ` Daryl Manning
@ 2023-01-17  8:22                             ` Tim Cross
  2023-01-17  9:15                               ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-17  8:22 UTC (permalink / raw)
  To: Daryl Manning; +Cc: rjhorn, emacs-orgmode

Daryl Manning <daryl@wakatara.com> writes:

> I'd argue that setting a specific datestamp  and time for DST would mean that you expected to meet at that
> specific time and date as per DST. If the clocks changed you'd be out of luck (that's where I'd argue you'd
> use a non-specified timezone for a meeting that re-occurs at 10:05 regardless of say PDT or PST).
>
> But if this was an issue with a recurring meeting, then when the clocks changed someone would be out an
> hour because they had specifically booked with DST in mind (note: this is more useful than you think -
> being in non-DST countries and having scheduled meetings in DST based countries, a lot of cal applications
> get this wrong when what I actually want is for that DST scheduled meeting to now be reflected in my
> calendar on the fact they've switched to ST in their time zone - so shifted an hour.). 
>
> But I feel this is something that would be for people who need to take advantage of this. And, more often
> than not, is a recurring meeting issue when DST/ST changes occur. 
>

Yes, this is one of the areas where there are some subtle issues to work
through. With regards to just meetings, I see 3 common scenarios

1. Meeting wiht all participants in the same time zone. The time (lets
say 3pm) should not change when daylight savings comes in or goes
out. The meeting is always at 3pm even though that 3pm might be
different when considered against UTC time.

2. A meeting where some participants are in different time zones to the
org user. Here it isn't clear exactly what should happen when there is a
daylight savings transition in the org user's time zone. Should the org
user's meeting time change or should the participants in the other time
zones update their time for the meeting. On one hand, it makes sense
that the local org user change the meeting time for themselves either
forward/back an hour because it is their time zone which has
changed. However, if the meting has a majority of participants in the
same time zone as the org user, perhaps those in the other time zones
should adjust. Point is, it isn't obvious and there isn't a 'right
solution'. Both needs to be supported and probably need to have some way
to indicate which is the preferred behaviour. 

3. An org user who travels and is often in a different time zone from
their 'home' time zone. IN this scenario, they probably want their
meeting times to be adjusted to the local time zone they are in (unless
they are already recorded in that time zone). Note that this was a
specific example form a previous feature request for time zone support
in org time stamps.

This is just wiht respect to timestamps used for meetings. There are
other scenarios with other subtle issues. For example, someone already
mentioned a scenario where org is being used to record details about
experiments. In this situation, the amount of 'real' time passed between
two timestamps is possibly the most important factor. The fact daylight
savings time transitions have occured are likely irrelevant - just
important any calculations relating to duration are accurate and not
thrown out by one hour due to the wall clock moving forward/abck an
hour.

So far, it seems clear that the solution needs to be flexible and
support timestamps without time zone information, with fully qualified
time zone specification, with time zone abbreviated names and with time
zone offsets.

It also seems that the solution will need some mechanism (possibly on a
per time stamp basis) for the user to specify what should happen when
either the time zone has a daylight savings transition, when the
timezone rules change or when the user's 'default' time zone changes
because they have changed locations. 


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 20:47                         ` Robert Horn
  2023-01-16 21:02                           ` Tom Gillespie
  2023-01-17  3:55                           ` Daryl Manning
@ 2023-01-17  8:45                           ` Ihor Radchenko
  2023-01-19 16:56                             ` Robert Horn
  2023-01-19 17:44                           ` Alexander Adolf
  2023-01-19 17:48                           ` Alexander Adolf
  4 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-17  8:45 UTC (permalink / raw)
  To: Robert Horn; +Cc: rjhorn, Daryl Manning, emacs-orgmode

Robert Horn <rjhorn@panix.com> writes:

>> Not really. Countries may change DST at any moment in future. Or decide
>> to switch calendars (consider countries near the day transition line).
>>
>> And "past local time, according to the DST rules in effect at the time"
>> is also an option that might be useful in certain scenarios.
>>
> The issue is clarity of the expected rules for the format.  If I
> schedule a meeting for 10:05 DST, but the rules change so that it is not
> DST at that location at that time in the future, what is the expected
> interpretation?  It could be:

Let me clarify. I do not think that we need to offer selecting DST/no
DST in the timestamp. Instead, we offer something like
<2028-12-11 18:00@Europe/Berlin>, specifying local time, including
possible DST transitions or any other political decisions the country
might make regarding the local time rules.

Or, if the preference is specifying time in such a way that it is
unaffected by the local time rules (for example, "+10000 hours from now,
no matter what the DST/no DST or whatever rules will happen in the
middle"), one can use explicit UTC offsets like <2028-12-11 18:00@UTC+02>

Can you think of any situations when these two variants are not
sufficient? AFAIU, they should cover your example just fine.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 21:48                             ` Robert Horn
@ 2023-01-17  8:53                               ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-17  8:53 UTC (permalink / raw)
  To: Robert Horn; +Cc: Tom Gillespie, emacs-orgmode, rjhorn

Robert Horn <rjhorn@panix.com> writes:

> Those who wanted astronomical or other relationships would usually
> specify UTC or TAI.  They might use a fixed offset for UTC.  People who
> are into the demands of TAI (e.g., orbital mechanics) generally don't
> want to deal with the offsets or other issues that come up with UTC, so
> they wanted TAI.

Unless time zone database supports TAI, we cannot support it.
Does someone know if TAI is available somewhere in TZdb?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 20:25               ` Tim Cross
@ 2023-01-17  9:07                 ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-17  9:07 UTC (permalink / raw)
  To: Tim Cross; +Cc: Daryl Manning, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> Daryl Manning <daryl@wakatara.com> writes:
>
>> I think timezone you're in should be declared globally, surely?  And then defined in the timestamp?
>>
>
> Do you mean globally as in at the OS level or globally in org mode. If
> the latter, I disagree. The OS has this information and there is no need
> for org to repeat it (and possibly hav it wrong). I would go the other
> direction and say that the TZ should only be defined in an org file i it
> differs from the OS setting.

I am not sure here.

Consider the following situation:

1. Someone lives in Berlin most of the time and has all the business
   activity, including meetings in Berlin.
2. All the timestamps, including scheduled meetings are thus recorded in
   local time - there is not much point specifying that it is
   Europe/Berlin when system time is Europe/Berlin anyway.
3. The meetings are scattered across various Org files.   
4. The same person goes on holiday to a different time zone with no
   plans to do work meetings there. No adjustments to Org settings or
   files are being made.
5. There is a meeting in Berlin time being scheduled shortly after the
   holiday.   
6. Due to emergency (say, flight delay), it becomes impossible to come
   back to Berlin in time. The meeting must be attended online thus.
7. The local computer time zone is automatically set to the local time
   though. And combined with the timestamps being scheduled in "local"
   time (assuming that they will only matter in Berlin), it becomes a
   problem. Note that the computer time zone should be retained to make
   agenda display real meeting times in local time.
8. Solution to that problem is telling Org somehow that all the
   timestamps without time zone specifier must be considered in
   Europe/Berlin, not local time zone. At least, temporarily.
9. The easiest way Org can support such need would be global "default"
   time zone. It will be easier than a need to go through every possible
   Org file on computer and hand-setting the Europe/Berlin there.   

So, I am in favour of allowing Org-global "default" time zone in addition
to setting it on per-file, per-heading, and per-timestamp basis.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* [FR] Allow BC years in timestamps (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)
  2023-01-16 20:51           ` Tom Gillespie
@ 2023-01-17  9:12             ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-17  9:12 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: emacs-orgmode, Tim Cross

Tom Gillespie <tgbugs@gmail.com> writes:

>> > As for years BC, <-0001-...> will be a breaking change. But I do not
>> > think that we need to really worry about this. Not unless we actually
>> > get feature request. What is the practical application?
>
> Using org as a format for writing about history and being able to
> reference dates in the past accurately and have the dates be
> first class entities that can be parsed and checked etc.
>
> The example in my head is a history professor who wants to
> write about e.g. the collapse of the Roman republic and not
> have to come up with their own time keeping system or force
> any one who wants to work with referenced dates to do a bunch
> of math to translate from a roman time system to a modern one.

This is an OK feature request. But it is orthogonal to time zones. Time
zones cannot help with BC years.

To support BC, we may need to change the timestamp format to, for
example, allow negative years. In addition, we might need to update
exporters to handle such scenarios.

Let's discuss BC/AC years in this thread, if there is further interest.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17  8:22                             ` Tim Cross
@ 2023-01-17  9:15                               ` Ihor Radchenko
  2023-01-17  9:45                                 ` Tim Cross
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-17  9:15 UTC (permalink / raw)
  To: Tim Cross; +Cc: Daryl Manning, rjhorn, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> It also seems that the solution will need some mechanism (possibly on a
> per time stamp basis) for the user to specify what should happen when
> either the time zone has a daylight savings transition, when the
> timezone rules change or when the user's 'default' time zone changes
> because they have changed locations. 

Could you please elaborate here?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17  9:15                               ` Ihor Radchenko
@ 2023-01-17  9:45                                 ` Tim Cross
  2023-01-18  9:15                                   ` Ihor Radchenko
  2023-01-18 17:09                                   ` Max Nikulin
  0 siblings, 2 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-17  9:45 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Daryl Manning, rjhorn, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Tim Cross <theophilusx@gmail.com> writes:
>
>> It also seems that the solution will need some mechanism (possibly on a
>> per time stamp basis) for the user to specify what should happen when
>> either the time zone has a daylight savings transition, when the
>> timezone rules change or when the user's 'default' time zone changes
>> because they have changed locations. 
>
> Could you please elaborate here?

I have some meetings scheduled in my org files which show up in the
agenda.

Meeting 1 is a reoccurring meeting which happens every 2 weeks. All of
the people in that meting are in the same timezone as I'm in. When we
transition into/out of daylight savings time, I don't want the timestamp
to change. THe meeting will remain at 3pm.

Meeting 2. This is also a reoccuring meeting. However, this meeting is
with people from a number of idfferent time zones. When my timezone
moves into or out of daylight savings time, I need the meeting time to
be updated - moved forward/back 1 hour.

Next week, I'm travelling to a different city for work and will be in a
different timezone. I need all my meetings to be adjusted except for
those I've already booked that are in the timezone I willl be in while
I'm away.

Finally, I have a few timestamps I use to track some projects and
progress on various tasks as well as reports showing actual and
estimated effort comparisons as well as managing billing/invoicing. The
actual timestamp times are less important than the calculation of
durations etc. When durations do cross daylight savings transition
points, it is critical that additonal hours are not accidentally
added/removed from the duration calculation. Mistakes here could result
in me loosing revenue or over charging clients.

So, for the first 2 I probably need to somehow flag/indicate that I do
or do not want the time adjusted as a result of a daylight savings
transition. For the 3rd group, I only want adjustments for timestamps
which are not in the 'current' (where I've travelled to) time zone. The
final one is really just about ensuring the transitions don't throw out
duration calculations accidentally.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 11:25           ` Ihor Radchenko
@ 2023-01-17 15:19             ` Jean Louis
  2023-01-18  9:38               ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-17 15:19 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Tim Cross, Daryl Manning, emacs-orgmode

* Ihor Radchenko <yantar92@posteo.net> [2023-01-16 14:25]:
> Jean Louis <bugs@gnu.support> writes:
> 
> >> I am not sure what is the problem.
> >> The timestamps that should stay in local time will be automatically
> >> updated as your system TZ is updated.
> >
> > Then Org shall know what was local time! Without being specified in
> > the time stamp, it has to be specified somewhere, as computer can't
> > know at which time zone was it specified.
> 
> We need nothing to use current time zone. And we already do it.
> 
> System clock knows the current time zone. Emacs has an ability to
> determine current time zone. See `current-time-zone'. This works
> automatically (and already) because we use `encode-time'.

Then you did not understand the point.

For users who use Org personally, in single place, single time zone,
who do no travel, who do not share headings, tasks, and files
internationally, they really do not need hussle with time zones!

However, when nice strong guy makes an Org file with list of tasks in
Ukraine and send it to nice girl Florida, she will simply think that
at 9 o'clock she has to discuss making visa with her fiance, but
fiance is already pissed off because she did not appear at online
meeting.

Time zones are useful for:

- people who travel from one time zone to other;
- people who share Org files, headings, tasks;

Of course I was doing it since 2016 until some year when I realized
that there are serious human usability related limits. 

But let's review, what would it be, when it would be that Jean works
in Org:

I have switched from Org to Hyperscope in June 2021:

# SELECT hypeoplerelations_datecreated FROM hypeoplerelations WHERE hypeoplerelations_hypeoplereltypes = 2 LIMIT 1;
 hypeoplerelations_datecreated 
-------------------------------
 2021-06-09 10:19:06.19327+03

That was the date when I slowly transitioned from sharing Org tasks to
people, in fact those were Org headings.

Since June 2021, I have shared 6176 time heading, without using Org,
to people all in various countries.

# SELECT count(1) FROM hypeoplerelations WHERE hypeoplerelations_hypeoplereltypes = 2;
 count 
-------
  6176
(1 row)

Time zones are small detail that does matter. 

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 11:21           ` Ihor Radchenko
  2023-01-16 11:30             ` Daryl Manning
@ 2023-01-17 15:24             ` Jean Louis
  2023-01-18  9:34               ` Ihor Radchenko
  1 sibling, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-17 15:24 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Tim Cross, Daryl Manning, emacs-orgmode

* Ihor Radchenko <yantar92@posteo.net> [2023-01-16 14:21]:
> In another message, I also mentioned an idea of specifying time zone
> globally or per file. Other suggestion was per-heading specification. In
> addition to time zone being specified directly inside the timestamp.

Of course that is solution. iCalendar export already supports time
zones. It was logical to author or maybe requirement of iCalendar.

And then comes the calculation, there must be way to re-calculate
representation of timestamps:

When there is global variable for Org file about time zone, then:

- every timestamp with time zone, shall be left intact or
re-calculated to diffrent local time zone. Imagine person giving Org
file from Russia to somebody in Florida, or travelling there. That
user or recipient would like to see the actual time, which is time for
him in Florida, but in its representation different from time in
Russia.

- ever timestamp with settings in heading, shall be calculated as
such.

It means there shall be functions which can convert timestamps to the
new time zone, with the option to left unchanged those timestamps who
already have time zone specified, and with option not to be converted.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 19:07                   ` Ihor Radchenko
  2023-01-16 19:22                     ` Robert Horn
@ 2023-01-17 15:37                     ` Jean Louis
  2023-01-18  9:29                       ` Ihor Radchenko
  2023-01-17 17:28                     ` Max Nikulin
  2 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-17 15:37 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Daryl Manning, emacs-orgmode

* Ihor Radchenko <yantar92@posteo.net> [2023-01-16 22:08]:
> 1. Time (YYYY-MM-DD HH:MM) not continuous and may change arbitrarily at
>    certain times a year or in future or in the past:

I am sure that system library must be responsible to know those
changes. It is not for Org. 

So the calculation which transforms +1 time zone to -5 time zone shall
be done by using system libraries which are supposed to have those
options. I have no idea if they have.

> 2. There might be arbitrary time gaps due to time transition, including

>    - One hour back during DST transition (northern and southern
>      hemispheres do the transitions in opposite directions)
>    - Multiple days skipped (Samoa skips a whole day during DST
>      transition)

Interesting, but I still think that shall be in system library, and
system libraries shall provide calculation functions. 

Does that exist in C library?

> 3. We cannot assume that the same geographical area has fixed time zone
>    even at given point of time:
>    - Palestinian/Israeli people follow different time zones in the
>      contested territories

They may, sure, I can also follow my own, but Org and system libraries
shall use internationally accepted norms.

> 4. Great Britain had new year on March 25 until 16th century
>    (March 24, 1000 -> (+1 day) March 25, 1001)

Of course, that is why December is called by that way, as the tenth
month, not twelfth. That may be part of representation of calendar,
but because it is history, it is not so important for us in future.

> 5. Leap seconds! 23:59:59 -> 23:59:60 -> 00:00:00, according to
>    astronomical Earth observations

Should be part of C library to observe those things.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 19:07                   ` Ihor Radchenko
  2023-01-16 19:22                     ` Robert Horn
  2023-01-17 15:37                     ` Jean Louis
@ 2023-01-17 17:28                     ` Max Nikulin
  2023-01-17 19:49                       ` Ihor Radchenko
  2023-01-18 16:20                       ` Jean Louis
  2 siblings, 2 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-17 17:28 UTC (permalink / raw)
  To: emacs-orgmode

On 17/01/2023 02:07, Ihor Radchenko wrote:
> https://www.youtube.com/watch?v=-5wpm-gesOY gives various examples.

More links:
- https://stackoverflow.com/tags/timezone/info
- 
https://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time
   Falsehoods programmers believe about time



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 18:37               ` Ihor Radchenko
@ 2023-01-17 17:40                 ` Max Nikulin
  2023-01-18  9:59                   ` Ihor Radchenko
  2023-01-18 16:24                   ` [SOLUTION] " Jean Louis
  0 siblings, 2 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-17 17:40 UTC (permalink / raw)
  To: emacs-orgmode

On 17/01/2023 01:37, Ihor Radchenko wrote:
>> Some formats may be confusing for users, e.g. TZ=GMT+5 actually means
>> -0500 offset.
> Let's just recommend +-XXXX and @location in the manual. And mention
> briefly that TZ format is supported in addition.
> 
> We might also provide an optional linter for GMT, if necessary.

"GMT" in this example is an arbitrary string. It adds some complications 
to the linter.

Notice that in POSIX "GMT+5" is *definition* of timezone with "GMT" 
abbreviation and shifted by 5 hours to the west. It is not a *reference* 
to IANA (Olson) Etc/GMT+5. I do not remember concerning "GMT", but Qt 
allows to use something like "UTC+5" (east like IANA, not west like 
POSIX). I am unsure concerning Windows, it may have an option of quite 
similar variant. That is why I am not sure to which degree Org should be 
liberal in respect to various time zones.




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17 17:28                     ` Max Nikulin
@ 2023-01-17 19:49                       ` Ihor Radchenko
  2023-01-18 16:21                         ` Jean Louis
  2023-01-18 16:20                       ` Jean Louis
  1 sibling, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-17 19:49 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> https://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time
>    Falsehoods programmers believe about time

Some potentially relevant items:

- Each calendar date is followed by the next in sequence, without
  skipping.
- The standard library supports negative years and years above 10000
- The day of the month always advances contiguously from N to either N+1
  or 1, with no discontinuities.
- There are 60 seconds in every minute.

All the above statements are FALSE!

All the above statements may affect, in particular, timestamps with
repeaters. Repeaters like +1h or +1d may require querying the TZdb (time
API).

Some good news is that all the above edge cases would equally affect the
current Org's timestamp handling code. Yet, we have no bug reports in
this area. I'd even go further and say that we should not try hard to
make things 100% accurate: (1) it will waste a lot of resources; (2)
users dealing with these edge cases are likely already accustomed to
most programs not handling things correctly for their special time zone
situations.

That said, if there is an easy way to handle some of the edge cases, we
can implement them.

Important: if some edge cases with time zones are buggy in OS time API,
it is not Org's job to work around the problem - we should rather report
those bugs upstream. What we should check, however, is the Org's own
ad-hoc code that is dealing with timestamps. In particular, I am
concerned about the repeater intervals. We will need to carefully review
the code to avoid nasty surprises.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17  9:45                                 ` Tim Cross
@ 2023-01-18  9:15                                   ` Ihor Radchenko
  2023-01-18 11:43                                     ` Tim Cross
  2023-01-18 17:09                                   ` Max Nikulin
  1 sibling, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-18  9:15 UTC (permalink / raw)
  To: Tim Cross; +Cc: Daryl Manning, rjhorn, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

>> Could you please elaborate here?
>
> I have some meetings scheduled in my org files which show up in the
> agenda.
>
> Meeting 1 is a reoccurring meeting which happens every 2 weeks. All of
> the people in that meting are in the same timezone as I'm in. When we
> transition into/out of daylight savings time, I don't want the timestamp
> to change. THe meeting will remain at 3pm.

Specifying the timezone should be good enough.
Not specifying will put you at a risk if you travel (you default OS
timezone will likely change).

> Meeting 2. This is also a reoccuring meeting. However, this meeting is
> with people from a number of idfferent time zones. When my timezone
> moves into or out of daylight savings time, I need the meeting time to
> be updated - moved forward/back 1 hour.

Again, you can just specify the right timezone and let Org translate it
to local one when calculating agenda.

> Next week, I'm travelling to a different city for work and will be in a
> different timezone. I need all my meetings to be adjusted except for
> those I've already booked that are in the timezone I willl be in while
> I'm away.

If you don't specify the timezone for both old and new meetings, there
will be no easy way to deal with this. What you may have to do is: (1)
indicate explicit timezone for the meetings in the new place (there will
probably be less of them compared to all other meetings); (2) tell Org
to use your old time zone as default - it will make the previously
scheduled meetings without timezone info use the right time zone.

> Finally, I have a few timestamps I use to track some projects and
> progress on various tasks as well as reports showing actual and
> estimated effort comparisons as well as managing billing/invoicing. The
> actual timestamp times are less important than the calculation of
> durations etc. When durations do cross daylight savings transition
> points, it is critical that additonal hours are not accidentally
> added/removed from the duration calculation. Mistakes here could result
> in me loosing revenue or over charging clients.

For the past timestamps, you can either: (1) make Org put UTC offsets
when recording clock data; (2) use the idea we discussed about multiple
default time zones where you can specify different time zones at
different periods of time (before after travel).

Does it sound good enough?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17 15:37                     ` Jean Louis
@ 2023-01-18  9:29                       ` Ihor Radchenko
  2023-01-18 16:11                         ` Jean Louis
  2023-01-18 21:31                         ` Tim Cross
  0 siblings, 2 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-18  9:29 UTC (permalink / raw)
  To: Jean Louis; +Cc: Daryl Manning, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

> ...
> Should be part of C library to observe those things.

Sure. My previous proposals are all relying on `encode-time' which uses
time.h from system libraries and utilizing TZDB that is taking care
about all this insanity.

We, however, might need to be careful about applying date increments. In
`org-read-date' and `org-timestamp-change', which are implemented in
Elisp without considering these complexities. (maybe also other
functions; these are just the ones I can think about)

What should we do when:

1. It is close to DST transition 2:59 -> 2:00 -> 2:01 -> ... -> 2:59 -> 3:00
   and the users asks to create a timestamp +1h from now
   or, worse, a timestamp +1h from now in a different time zone

2. A user asks +1w date shift and the time zone has a 1-day jump during DST?
   what about +7d? +1d?

3. What will be +1d 2:30am timestamp refer to when there DST transition
   as in (1)?


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17 15:24             ` Jean Louis
@ 2023-01-18  9:34               ` Ihor Radchenko
  2023-01-18 16:07                 ` Jean Louis
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-18  9:34 UTC (permalink / raw)
  To: Jean Louis; +Cc: Tim Cross, Daryl Manning, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

> When there is global variable for Org file about time zone, then:
>
> - every timestamp with time zone, shall be left intact or
> re-calculated to diffrent local time zone. Imagine person giving Org
> file from Russia to somebody in Florida, or travelling there. That
> user or recipient would like to see the actual time, which is time for
> him in Florida, but in its representation different from time in
> Russia.

Sure. I imagine `org-display-custom-times' could handle this.

> - ever timestamp with settings in heading, shall be calculated as
> such.
>
> It means there shall be functions which can convert timestamps to the
> new time zone, with the option to left unchanged those timestamps who
> already have time zone specified, and with option not to be converted.

I am not sure why you need a difference here.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17 15:19             ` Jean Louis
@ 2023-01-18  9:38               ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-18  9:38 UTC (permalink / raw)
  To: Jean Louis; +Cc: Tim Cross, Daryl Manning, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

>> >> I am not sure what is the problem.
>> >> The timestamps that should stay in local time will be automatically
>> >> updated as your system TZ is updated.
>> >
>> > Then Org shall know what was local time! Without being specified in
>> > the time stamp, it has to be specified somewhere, as computer can't
>> > know at which time zone was it specified.
>> 
>> We need nothing to use current time zone. And we already do it.
>> 
>> System clock knows the current time zone. Emacs has an ability to
>> determine current time zone. See `current-time-zone'. This works
>> automatically (and already) because we use `encode-time'.
>
> Then you did not understand the point.
>
> For users who use Org personally, in single place, single time zone,
> who do no travel, who do not share headings, tasks, and files
> internationally, they really do not need hussle with time zones!
>
> However, when nice strong guy makes an Org file with list of tasks in
> Ukraine and send it to nice girl Florida, she will simply think that
> at 9 o'clock she has to discuss making visa with her fiance, but
> fiance is already pissed off because she did not appear at online
> meeting.

Sure. Then, a guy from Ukraine can add default timezone to the shared
file/heading. It will then apply to all the timestamps that do not
explicitly specify the time zone in the file/heading contents.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17 17:40                 ` Max Nikulin
@ 2023-01-18  9:59                   ` Ihor Radchenko
  2023-01-18 16:25                     ` Jean Louis
  2023-01-18 16:24                   ` [SOLUTION] " Jean Louis
  1 sibling, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-18  9:59 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> ... I am unsure concerning Windows, it may have an option of quite 
> similar variant. That is why I am not sure to which degree Org should be 
> liberal in respect to various time zones.

May we just support whatever TZ supports (POSIX)?

I was also thinking about ISO 8601, but it interferes with time ranges
(4:00-8:00 may be both "from 2am to 8am" and "4am UTC-08"). Though other
ISO 8601 variants like 4:00-0800 might work.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18  9:15                                   ` Ihor Radchenko
@ 2023-01-18 11:43                                     ` Tim Cross
  2023-01-18 12:02                                       ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-18 11:43 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Daryl Manning, rjhorn, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Tim Cross <theophilusx@gmail.com> writes:
>
>>> Could you please elaborate here?
>>
>> I have some meetings scheduled in my org files which show up in the
>> agenda.
>>
>> Meeting 1 is a reoccurring meeting which happens every 2 weeks. All of
>> the people in that meting are in the same timezone as I'm in. When we
>> transition into/out of daylight savings time, I don't want the timestamp
>> to change. THe meeting will remain at 3pm.
>
> Specifying the timezone should be good enough.
> Not specifying will put you at a risk if you travel (you default OS
> timezone will likely change).
>
>> Meeting 2. This is also a reoccuring meeting. However, this meeting is
>> with people from a number of idfferent time zones. When my timezone
>> moves into or out of daylight savings time, I need the meeting time to
>> be updated - moved forward/back 1 hour.
>
> Again, you can just specify the right timezone and let Org translate it
> to local one when calculating agenda.
>
>> Next week, I'm travelling to a different city for work and will be in a
>> different timezone. I need all my meetings to be adjusted except for
>> those I've already booked that are in the timezone I willl be in while
>> I'm away.
>
> If you don't specify the timezone for both old and new meetings, there
> will be no easy way to deal with this. What you may have to do is: (1)
> indicate explicit timezone for the meetings in the new place (there will
> probably be less of them compared to all other meetings); (2) tell Org
> to use your old time zone as default - it will make the previously
> scheduled meetings without timezone info use the right time zone.
>
>> Finally, I have a few timestamps I use to track some projects and
>> progress on various tasks as well as reports showing actual and
>> estimated effort comparisons as well as managing billing/invoicing. The
>> actual timestamp times are less important than the calculation of
>> durations etc. When durations do cross daylight savings transition
>> points, it is critical that additonal hours are not accidentally
>> added/removed from the duration calculation. Mistakes here could result
>> in me loosing revenue or over charging clients.
>
> For the past timestamps, you can either: (1) make Org put UTC offsets
> when recording clock data; (2) use the idea we discussed about multiple
> default time zones where you can specify different time zones at
> different periods of time (before after travel).
>
> Does it sound good enough?

No, I'm afraid not. How does org distinguish between meeting 1 and
meeting 2? IN meeting one, when the timezone transitions in/out of
daylight savings, nothing needs to change, but in meeting 2, when this
occurs, the meeting needs to be re-sechduled so that it keeps the same
offset relative to UTC. Some mechanism is needed so that the user can
identify timestamps like those fo rmeeting 1 from those for meeting
2. My idea was to have meeting 1 type timestamps without TZ info and
meeting 2 require fully qualified TZ info. However, while this would
probably work, I don't like it because it isn't explicit and would be
prone to errors.

Note that the above is a real scenario - I have to deal with this type
of problem frequently. The other types can, in general, be handled
through judicious use of TZ settings.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18 11:43                                     ` Tim Cross
@ 2023-01-18 12:02                                       ` Ihor Radchenko
  2023-01-18 21:16                                         ` Tim Cross
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-18 12:02 UTC (permalink / raw)
  To: Tim Cross; +Cc: Daryl Manning, rjhorn, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

>> Does it sound good enough?
>
> No, I'm afraid not. How does org distinguish between meeting 1 and
> meeting 2? IN meeting one, when the timezone transitions in/out of
> daylight savings, nothing needs to change, but in meeting 2, when this
> occurs, the meeting needs to be re-sechduled so that it keeps the same
> offset relative to UTC.
> Some mechanism is needed so that the user can
> identify timestamps like those fo rmeeting 1 from those for meeting
> 2. My idea was to have meeting 1 type timestamps without TZ info and
> meeting 2 require fully qualified TZ info. However, while this would
> probably work, I don't like it because it isn't explicit and would be
> prone to errors.

I still don't understand.

In Org, you will have a default time zone that will be used to build the
agenda.

In meeting 1, you set the time zone to your local zone
In meeting 2, you set the time zone to the time zone where the meeting
is scheduled.

The, both the meetings will be first converted to the default time zone
and appear in your agenda adjusted as required.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18  9:34               ` Ihor Radchenko
@ 2023-01-18 16:07                 ` Jean Louis
  2023-01-19 10:43                   ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-18 16:07 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Tim Cross, Daryl Manning, emacs-orgmode

* Ihor Radchenko <yantar92@posteo.net> [2023-01-18 12:35]:
> > It means there shall be functions which can convert timestamps to the
> > new time zone, with the option to left unchanged those timestamps who
> > already have time zone specified, and with option not to be converted.
> 
> I am not sure why you need a difference here.

Today I was writing offers where I specified en_US time format, and
where I send it from EAT time zone, just realizing that people in US
can't understand how did I send the e-mail ahead of time. My
mistake. It is better that I represent it in their time, then they
will know it was night in their city when I was sending it.

Time shall be displayed correctly to the person in that other time
zone, preferrably in his time zone, not mine.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18  9:29                       ` Ihor Radchenko
@ 2023-01-18 16:11                         ` Jean Louis
  2023-01-18 21:31                         ` Tim Cross
  1 sibling, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-18 16:11 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Daryl Manning, emacs-orgmode

* Ihor Radchenko <yantar92@posteo.net> [2023-01-18 12:29]:
> What should we do when:
> 
> 1. It is close to DST transition 2:59 -> 2:00 -> 2:01 -> ... -> 2:59 -> 3:00
>    and the users asks to create a timestamp +1h from now
>    or, worse, a timestamp +1h from now in a different time zone

I still understand that it should be job of underlying system
functions. Org is only invoking addition by using system time:

From Org timestamp with time zone one has to use system functions, to
add, or deduct time, then again to Org time representation.

> 2. A user asks +1w date shift and the time zone has a 1-day jump during DST?
>    what about +7d? +1d?

That is all for system functions to know. Is not good on the higher
level (of Org) to start deciding about international issues that shall
be recorded in C libraries somewhere, time zone databases, etc


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17 17:28                     ` Max Nikulin
  2023-01-17 19:49                       ` Ihor Radchenko
@ 2023-01-18 16:20                       ` Jean Louis
  2023-01-20 16:27                         ` Max Nikulin
  1 sibling, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-18 16:20 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

* Max Nikulin <manikulin@gmail.com> [2023-01-17 20:31]:
> On 17/01/2023 02:07, Ihor Radchenko wrote:
> > https://www.youtube.com/watch?v=-5wpm-gesOY gives various examples.
> 
> More links:
> - https://stackoverflow.com/tags/timezone/info
> - https://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time
>   Falsehoods programmers believe about time

Seems overwhelming to satisfy all requirement.

Is there any program, software, system, that is really so good with
time, apart from PostgreSQL database that I know with 1195 defined
time zones?

SELECT
    name,
    abbrev,
    utc_offset,
    is_dst
FROM pg_timezone_names;

                  name                  | abbrev | utc_offset | is_dst 
----------------------------------------+--------+------------+--------
 NZ                                     | NZDT   | 13:00:00   | t
 GB-Eire                                | GMT    | 00:00:00   | f
 Canada/Yukon                           | MST    | -07:00:00  | f
 Canada/Atlantic                        | AST    | -04:00:00  | f
 Canada/Pacific                         | PST    | -08:00:00  | f
 Canada/Eastern                         | EST    | -05:00:00  | f
 Canada/Central                         | CST    | -06:00:00  | f
 Canada/Saskatchewan                    | CST    | -06:00:00  | f
 Canada/Newfoundland                    | NST    | -03:30:00  | f
 Canada/Mountain                        | MST    | -07:00:00  | f
 Japan                                  | JST    | 09:00:00   | f
 Kwajalein                              | +12    | 12:00:00   | f
 Egypt                                  | EET    | 02:00:00   | f
 Poland                                 | CET    | 01:00:00   | f
 Turkey                                 | +03    | 03:00:00   | f
 CET                                    | CET    | 01:00:00   | f
 Brazil/DeNoronha                       | -02    | -02:00:00  | f
 Brazil/East                            | -03    | -03:00:00  | f
 Brazil/West                            | -04    | -04:00:00  | f
 Brazil/Acre                            | -05    | -05:00:00  | f
 Chile/Continental                      | -03    | -03:00:00  | t
 Chile/EasterIsland                     | -05    | -05:00:00  | t
 EST5EDT                                | EST    | -05:00:00  | f
 Atlantic/Jan_Mayen                     | CET    | 01:00:00   | f
 Atlantic/Cape_Verde                    | -01    | -01:00:00  | f
 Atlantic/South_Georgia                 | -02    | -02:00:00  | f
 Atlantic/Faroe                         | WET    | 00:00:00   | f
 Atlantic/St_Helena                     | GMT    | 00:00:00   | f
 Atlantic/Azores                        | -01    | -01:00:00  | f
 Atlantic/Madeira                       | WET    | 00:00:00   | f
 Atlantic/Stanley                       | -03    | -03:00:00  | f
 Atlantic/Bermuda                       | AST    | -04:00:00  | f
 Atlantic/Canary                        | WET    | 00:00:00   | f
 Atlantic/Reykjavik                     | GMT    | 00:00:00   | f
 Atlantic/Faeroe                        | WET    | 00:00:00   | f
 Iceland                                | GMT    | 00:00:00   | f
 GMT0                                   | GMT    | 00:00:00   | f
 EST                                    | EST    | -05:00:00  | f
 PRC                                    | CST    | 08:00:00   | f
 Cuba                                   | CST    | -05:00:00  | f
 Eire                                   | GMT    | 00:00:00   | t
 HST                                    | HST    | -10:00:00  | f
 GMT                                    | GMT    | 00:00:00   | f
 Greenwich                              | GMT    | 00:00:00   | f
 CST6CDT                                | CST    | -06:00:00  | f
 W-SU                                   | MSK    | 03:00:00   | f
 GMT+0                                  | GMT    | 00:00:00   | f
 EET                                    | EET    | 02:00:00   | f
 Etc/GMT-2                              | +02    | 02:00:00   | f
 Etc/GMT-13                             | +13    | 13:00:00   | f
 Etc/GMT+2                              | -02    | -02:00:00  | f
 Etc/GMT+7                              | -07    | -07:00:00  | f
 Etc/GMT-12                             | +12    | 12:00:00   | f
 Etc/GMT-5                              | +05    | 05:00:00   | f
 Etc/GMT-11                             | +11    | 11:00:00   | f
 Etc/GMT0                               | GMT    | 00:00:00   | f
 Etc/GMT+6                              | -06    | -06:00:00  | f
 Etc/GMT                                | GMT    | 00:00:00   | f
 Etc/Greenwich                          | GMT    | 00:00:00   | f
 Etc/GMT+0                              | GMT    | 00:00:00   | f
 Etc/GMT+4                              | -04    | -04:00:00  | f
 Etc/GMT-6                              | +06    | 06:00:00   | f
 Etc/GMT+11                             | -11    | -11:00:00  | f
 Etc/GMT+8                              | -08    | -08:00:00  | f
 Etc/GMT-8                              | +08    | 08:00:00   | f
 Etc/GMT+3                              | -03    | -03:00:00  | f
 Etc/GMT+5                              | -05    | -05:00:00  | f
 Etc/Universal                          | UTC    | 00:00:00   | f
 Etc/GMT+1                              | -01    | -01:00:00  | f
 Etc/UCT                                | UTC    | 00:00:00   | f
 Etc/GMT+12                             | -12    | -12:00:00  | f
 Etc/GMT-10                             | +10    | 10:00:00   | f
 Etc/GMT-7                              | +07    | 07:00:00   | f
 Etc/GMT-0                              | GMT    | 00:00:00   | f
 Etc/Zulu                               | UTC    | 00:00:00   | f
 Etc/GMT-14                             | +14    | 14:00:00   | f
 Etc/UTC                                | UTC    | 00:00:00   | f
 Etc/GMT-1                              | +01    | 01:00:00   | f
 Etc/GMT+9                              | -09    | -09:00:00  | f
 Etc/GMT-3                              | +03    | 03:00:00   | f
 Etc/GMT-4                              | +04    | 04:00:00   | f
 Etc/GMT+10                             | -10    | -10:00:00  | f
 Etc/GMT-9                              | +09    | 09:00:00   | f
 Pacific/Wake                           | +12    | 12:00:00   | f
 Pacific/Saipan                         | ChST   | 10:00:00   | f
 Pacific/Kwajalein                      | +12    | 12:00:00   | f
 Pacific/Chuuk                          | +10    | 10:00:00   | f
 Pacific/Chatham                        | +1345  | 13:45:00   | t
 Pacific/Pitcairn                       | -08    | -08:00:00  | f
 Pacific/Honolulu                       | HST    | -10:00:00  | f
 Pacific/Johnston                       | HST    | -10:00:00  | f
 Pacific/Niue                           | -11    | -11:00:00  | f
 Pacific/Yap                            | +10    | 10:00:00   | f
 Pacific/Guadalcanal                    | +11    | 11:00:00   | f
 Pacific/Tarawa                         | +12    | 12:00:00   | f
 Pacific/Palau                          | +09    | 09:00:00   | f
 Pacific/Samoa                          | SST    | -11:00:00  | f
 Pacific/Majuro                         | +12    | 12:00:00   | f
 Pacific/Port_Moresby                   | +10    | 10:00:00   | f
 Pacific/Apia                           | +13    | 13:00:00   | f
 Pacific/Truk                           | +10    | 10:00:00   | f
 Pacific/Marquesas                      | -0930  | -09:30:00  | f
 Pacific/Efate                          | +11    | 11:00:00   | f
 Pacific/Pago_Pago                      | SST    | -11:00:00  | f
 Pacific/Kosrae                         | +11    | 11:00:00   | f
 Pacific/Nauru                          | +12    | 12:00:00   | f
 Pacific/Enderbury                      | +13    | 13:00:00   | f
 Pacific/Bougainville                   | +11    | 11:00:00   | f
 Pacific/Wallis                         | +12    | 12:00:00   | f
 Pacific/Fakaofo                        | +13    | 13:00:00   | f
 Pacific/Kanton                         | +13    | 13:00:00   | f
 Pacific/Midway                         | SST    | -11:00:00  | f
 Pacific/Tongatapu                      | +13    | 13:00:00   | f
 Pacific/Noumea                         | +11    | 11:00:00   | f
 Pacific/Tahiti                         | -10    | -10:00:00  | f
 Pacific/Gambier                        | -09    | -09:00:00  | f
 Pacific/Rarotonga                      | -10    | -10:00:00  | f
 Pacific/Pohnpei                        | +11    | 11:00:00   | f
 Pacific/Fiji                           | +12    | 12:00:00   | f
 Pacific/Auckland                       | NZDT   | 13:00:00   | t
 Pacific/Kiritimati                     | +14    | 14:00:00   | f
 Pacific/Guam                           | ChST   | 10:00:00   | f
 Pacific/Norfolk                        | +12    | 12:00:00   | t
 Pacific/Galapagos                      | -06    | -06:00:00  | f
 Pacific/Easter                         | -05    | -05:00:00  | t
 Pacific/Funafuti                       | +12    | 12:00:00   | f
 Pacific/Ponape                         | +11    | 11:00:00   | f
 ROC                                    | CST    | 08:00:00   | f
 Europe/Vaduz                           | CET    | 01:00:00   | f
 Europe/Belfast                         | GMT    | 00:00:00   | f
 Europe/Volgograd                       | +03    | 03:00:00   | f
 Europe/Copenhagen                      | CET    | 01:00:00   | f
 Europe/Minsk                           | +03    | 03:00:00   | f
 Europe/Sofia                           | EET    | 02:00:00   | f
 Europe/Warsaw                          | CET    | 01:00:00   | f
 Europe/San_Marino                      | CET    | 01:00:00   | f
 Europe/Riga                            | EET    | 02:00:00   | f
 Europe/Kiev                            | EET    | 02:00:00   | f
 Europe/Isle_of_Man                     | GMT    | 00:00:00   | f
 Europe/Chisinau                        | EET    | 02:00:00   | f
 Europe/Prague                          | CET    | 01:00:00   | f
 Europe/Brussels                        | CET    | 01:00:00   | f
 Europe/Tiraspol                        | EET    | 02:00:00   | f
 Europe/Podgorica                       | CET    | 01:00:00   | f
 Europe/Guernsey                        | GMT    | 00:00:00   | f
 Europe/Vienna                          | CET    | 01:00:00   | f
 Europe/Sarajevo                        | CET    | 01:00:00   | f
 Europe/Kaliningrad                     | EET    | 02:00:00   | f
 Europe/Busingen                        | CET    | 01:00:00   | f
 Europe/Zaporozhye                      | EET    | 02:00:00   | f
 Europe/Ljubljana                       | CET    | 01:00:00   | f
 Europe/Bucharest                       | EET    | 02:00:00   | f
 Europe/Berlin                          | CET    | 01:00:00   | f
 Europe/Tallinn                         | EET    | 02:00:00   | f
 Europe/London                          | GMT    | 00:00:00   | f
 Europe/Paris                           | CET    | 01:00:00   | f
 Europe/Amsterdam                       | CET    | 01:00:00   | f
 Europe/Istanbul                        | +03    | 03:00:00   | f
 Europe/Vilnius                         | EET    | 02:00:00   | f
 Europe/Nicosia                         | EET    | 02:00:00   | f
 Europe/Astrakhan                       | +04    | 04:00:00   | f
 Europe/Saratov                         | +04    | 04:00:00   | f
 Europe/Jersey                          | GMT    | 00:00:00   | f
 Europe/Moscow                          | MSK    | 03:00:00   | f
 Europe/Helsinki                        | EET    | 02:00:00   | f
 Europe/Belgrade                        | CET    | 01:00:00   | f
 Europe/Kirov                           | +03    | 03:00:00   | f
 Europe/Kyiv                            | EET    | 02:00:00   | f
 Europe/Gibraltar                       | CET    | 01:00:00   | f
 Europe/Samara                          | +04    | 04:00:00   | f
 Europe/Ulyanovsk                       | +04    | 04:00:00   | f
 Europe/Andorra                         | CET    | 01:00:00   | f
 Europe/Oslo                            | CET    | 01:00:00   | f
 Europe/Uzhgorod                        | EET    | 02:00:00   | f
 Europe/Budapest                        | CET    | 01:00:00   | f
 Europe/Skopje                          | CET    | 01:00:00   | f
 Europe/Mariehamn                       | EET    | 02:00:00   | f
 Europe/Stockholm                       | CET    | 01:00:00   | f
 Europe/Zurich                          | CET    | 01:00:00   | f
 Europe/Zagreb                          | CET    | 01:00:00   | f
 Europe/Monaco                          | CET    | 01:00:00   | f
 Europe/Simferopol                      | MSK    | 03:00:00   | f
 Europe/Vatican                         | CET    | 01:00:00   | f
 Europe/Tirane                          | CET    | 01:00:00   | f
 Europe/Madrid                          | CET    | 01:00:00   | f
 Europe/Athens                          | EET    | 02:00:00   | f
 Europe/Dublin                          | GMT    | 00:00:00   | t
 Europe/Malta                           | CET    | 01:00:00   | f
 Europe/Rome                            | CET    | 01:00:00   | f
 Europe/Luxembourg                      | CET    | 01:00:00   | f
 Europe/Lisbon                          | WET    | 00:00:00   | f
 Europe/Bratislava                      | CET    | 01:00:00   | f
 Navajo                                 | MST    | -07:00:00  | f
 PST8PDT                                | PST    | -08:00:00  | f
 ROK                                    | KST    | 09:00:00   | f
 Portugal                               | WET    | 00:00:00   | f
 MET                                    | MET    | 01:00:00   | f
 Antarctica/McMurdo                     | NZDT   | 13:00:00   | t
 Antarctica/Vostok                      | +06    | 06:00:00   | f
 Antarctica/South_Pole                  | NZDT   | 13:00:00   | t
 Antarctica/Syowa                       | +03    | 03:00:00   | f
 Antarctica/Mawson                      | +05    | 05:00:00   | f
 Antarctica/DumontDUrville              | +10    | 10:00:00   | f
 Antarctica/Rothera                     | -03    | -03:00:00  | f
 Antarctica/Davis                       | +07    | 07:00:00   | f
 Antarctica/Palmer                      | -03    | -03:00:00  | f
 Antarctica/Troll                       | +00    | 00:00:00   | f
 Antarctica/Macquarie                   | AEDT   | 11:00:00   | t
 Antarctica/Casey                       | +11    | 11:00:00   | f
 NZ-CHAT                                | +1345  | 13:45:00   | t
 Universal                              | UTC    | 00:00:00   | f
 MST                                    | MST    | -07:00:00  | f
 Jamaica                                | EST    | -05:00:00  | f
 UCT                                    | UTC    | 00:00:00   | f
 Factory                                | -00    | 00:00:00   | f
 GB                                     | GMT    | 00:00:00   | f
 US/Aleutian                            | HST    | -10:00:00  | f
 US/Hawaii                              | HST    | -10:00:00  | f
 US/Arizona                             | MST    | -07:00:00  | f
 US/Indiana-Starke                      | CST    | -06:00:00  | f
 US/Pacific                             | PST    | -08:00:00  | f
 US/Samoa                               | SST    | -11:00:00  | f
 US/Michigan                            | EST    | -05:00:00  | f
 US/Eastern                             | EST    | -05:00:00  | f
 US/Central                             | CST    | -06:00:00  | f
 US/Alaska                              | AKST   | -09:00:00  | f
 US/Mountain                            | MST    | -07:00:00  | f
 US/East-Indiana                        | EST    | -05:00:00  | f
 Indian/Chagos                          | +06    | 06:00:00   | f
 Indian/Comoro                          | EAT    | 03:00:00   | f
 Indian/Maldives                        | +05    | 05:00:00   | f
 Indian/Antananarivo                    | EAT    | 03:00:00   | f
 Indian/Christmas                       | +07    | 07:00:00   | f
 Indian/Mauritius                       | +04    | 04:00:00   | f
 Indian/Mayotte                         | EAT    | 03:00:00   | f
 Indian/Cocos                           | +0630  | 06:30:00   | f
 Indian/Reunion                         | +04    | 04:00:00   | f
 Indian/Kerguelen                       | +05    | 05:00:00   | f
 Indian/Mahe                            | +04    | 04:00:00   | f
 Singapore                              | +08    | 08:00:00   | f
 GMT-0                                  | GMT    | 00:00:00   | f
 Zulu                                   | UTC    | 00:00:00   | f
 Australia/Lord_Howe                    | +11    | 11:00:00   | t
 Australia/Broken_Hill                  | ACDT   | 10:30:00   | t
 Australia/Adelaide                     | ACDT   | 10:30:00   | t
 Australia/Sydney                       | AEDT   | 11:00:00   | t
 Australia/Canberra                     | AEDT   | 11:00:00   | t
 Australia/NSW                          | AEDT   | 11:00:00   | t
 Australia/Yancowinna                   | ACDT   | 10:30:00   | t
 Australia/LHI                          | +11    | 11:00:00   | t
 Australia/West                         | AWST   | 08:00:00   | f
 Australia/South                        | ACDT   | 10:30:00   | t
 Australia/Melbourne                    | AEDT   | 11:00:00   | t
 Australia/Eucla                        | +0845  | 08:45:00   | f
 Australia/Tasmania                     | AEDT   | 11:00:00   | t
 Australia/Hobart                       | AEDT   | 11:00:00   | t
 Australia/Currie                       | AEDT   | 11:00:00   | t
 Australia/Perth                        | AWST   | 08:00:00   | f
 Australia/ACT                          | AEDT   | 11:00:00   | t
 Australia/Queensland                   | AEST   | 10:00:00   | f
 Australia/North                        | ACST   | 09:30:00   | f
 Australia/Lindeman                     | AEST   | 10:00:00   | f
 Australia/Darwin                       | ACST   | 09:30:00   | f
 Australia/Brisbane                     | AEST   | 10:00:00   | f
 Australia/Victoria                     | AEDT   | 11:00:00   | t
 UTC                                    | UTC    | 00:00:00   | f
 Libya                                  | EET    | 02:00:00   | f
 Arctic/Longyearbyen                    | CET    | 01:00:00   | f
 America/Ciudad_Juarez                  | MST    | -07:00:00  | f
 America/Ojinaga                        | CST    | -06:00:00  | f
 America/Godthab                        | -03    | -03:00:00  | f
 America/Fort_Nelson                    | MST    | -07:00:00  | f
 America/Paramaribo                     | -03    | -03:00:00  | f
 America/Sao_Paulo                      | -03    | -03:00:00  | f
 America/Campo_Grande                   | -04    | -04:00:00  | f
 America/Bahia                          | -03    | -03:00:00  | f
 America/Detroit                        | EST    | -05:00:00  | f
 America/Winnipeg                       | CST    | -06:00:00  | f
 America/Belem                          | -03    | -03:00:00  | f
 America/Boise                          | MST    | -07:00:00  | f
 America/Araguaina                      | -03    | -03:00:00  | f
 America/Belize                         | CST    | -06:00:00  | f
 America/Anguilla                       | AST    | -04:00:00  | f
 America/Marigot                        | AST    | -04:00:00  | f
 America/Yakutat                        | AKST   | -09:00:00  | f
 America/Danmarkshavn                   | GMT    | 00:00:00   | f
 America/Indianapolis                   | EST    | -05:00:00  | f
 America/Maceio                         | -03    | -03:00:00  | f
 America/Caracas                        | -04    | -04:00:00  | f
 America/Swift_Current                  | CST    | -06:00:00  | f
 America/Coral_Harbour                  | EST    | -05:00:00  | f
 America/El_Salvador                    | CST    | -06:00:00  | f
 America/Argentina/San_Luis             | -03    | -03:00:00  | f
 America/Argentina/La_Rioja             | -03    | -03:00:00  | f
 America/Argentina/Jujuy                | -03    | -03:00:00  | f
 America/Argentina/Mendoza              | -03    | -03:00:00  | f
 America/Argentina/Catamarca            | -03    | -03:00:00  | f
 America/Argentina/Buenos_Aires         | -03    | -03:00:00  | f
 America/Argentina/San_Juan             | -03    | -03:00:00  | f
 America/Argentina/Cordoba              | -03    | -03:00:00  | f
 America/Argentina/Rio_Gallegos         | -03    | -03:00:00  | f
 America/Argentina/ComodRivadavia       | -03    | -03:00:00  | f
 America/Argentina/Salta                | -03    | -03:00:00  | f
 America/Argentina/Ushuaia              | -03    | -03:00:00  | f
 America/Argentina/Tucuman              | -03    | -03:00:00  | f
 America/Santa_Isabel                   | PST    | -08:00:00  | f
 America/Fort_Wayne                     | EST    | -05:00:00  | f
 America/St_Kitts                       | AST    | -04:00:00  | f
 America/Juneau                         | AKST   | -09:00:00  | f
 America/Tegucigalpa                    | CST    | -06:00:00  | f
 America/Los_Angeles                    | PST    | -08:00:00  | f
 America/St_Lucia                       | AST    | -04:00:00  | f
 America/Atikokan                       | EST    | -05:00:00  | f
 America/La_Paz                         | -04    | -04:00:00  | f
 America/Guyana                         | -04    | -04:00:00  | f
 America/Cayenne                        | -03    | -03:00:00  | f
 America/Metlakatla                     | AKST   | -09:00:00  | f
 America/Monterrey                      | CST    | -06:00:00  | f
 America/Toronto                        | EST    | -05:00:00  | f
 America/Denver                         | MST    | -07:00:00  | f
 America/Kralendijk                     | AST    | -04:00:00  | f
 America/Montreal                       | EST    | -05:00:00  | f
 America/Grand_Turk                     | EST    | -05:00:00  | f
 America/Hermosillo                     | MST    | -07:00:00  | f
 America/Rankin_Inlet                   | CST    | -06:00:00  | f
 America/Miquelon                       | -03    | -03:00:00  | f
 America/Jujuy                          | -03    | -03:00:00  | f
 America/Mendoza                        | -03    | -03:00:00  | f
 America/Guayaquil                      | -05    | -05:00:00  | f
 America/Port-au-Prince                 | EST    | -05:00:00  | f
 America/Nassau                         | EST    | -05:00:00  | f
 America/Panama                         | EST    | -05:00:00  | f
 America/Regina                         | CST    | -06:00:00  | f
 America/Catamarca                      | -03    | -03:00:00  | f
 America/Asuncion                       | -03    | -03:00:00  | t
 America/Iqaluit                        | EST    | -05:00:00  | f
 America/Santo_Domingo                  | AST    | -04:00:00  | f
 America/Antigua                        | AST    | -04:00:00  | f
 America/Grenada                        | AST    | -04:00:00  | f
 America/Merida                         | CST    | -06:00:00  | f
 America/Buenos_Aires                   | -03    | -03:00:00  | f
 America/Nuuk                           | -03    | -03:00:00  | f
 America/Scoresbysund                   | -01    | -01:00:00  | f
 America/Chihuahua                      | CST    | -06:00:00  | f
 America/Dominica                       | AST    | -04:00:00  | f
 America/Ensenada                       | PST    | -08:00:00  | f
 America/Blanc-Sablon                   | AST    | -04:00:00  | f
 America/Adak                           | HST    | -10:00:00  | f
 America/Vancouver                      | PST    | -08:00:00  | f
 America/Yellowknife                    | MST    | -07:00:00  | f
 America/Edmonton                       | MST    | -07:00:00  | f
 America/Cancun                         | EST    | -05:00:00  | f
 America/Kentucky/Monticello            | EST    | -05:00:00  | f
 America/Kentucky/Louisville            | EST    | -05:00:00  | f
 America/Thunder_Bay                    | EST    | -05:00:00  | f
 America/Thule                          | AST    | -04:00:00  | f
 America/Noronha                        | -02    | -02:00:00  | f
 America/Recife                         | -03    | -03:00:00  | f
 America/Port_of_Spain                  | AST    | -04:00:00  | f
 America/Chicago                        | CST    | -06:00:00  | f
 America/Bogota                         | -05    | -05:00:00  | f
 America/Indiana/Indianapolis           | EST    | -05:00:00  | f
 America/Indiana/Winamac                | EST    | -05:00:00  | f
 America/Indiana/Marengo                | EST    | -05:00:00  | f
 America/Indiana/Knox                   | CST    | -06:00:00  | f
 America/Indiana/Vincennes              | EST    | -05:00:00  | f
 America/Indiana/Petersburg             | EST    | -05:00:00  | f
 America/Indiana/Tell_City              | CST    | -06:00:00  | f
 America/Indiana/Vevay                  | EST    | -05:00:00  | f
 America/St_Johns                       | NST    | -03:30:00  | f
 America/Tijuana                        | PST    | -08:00:00  | f
 America/Cordoba                        | -03    | -03:00:00  | f
 America/Knox_IN                        | CST    | -06:00:00  | f
 America/New_York                       | EST    | -05:00:00  | f
 America/Shiprock                       | MST    | -07:00:00  | f
 America/Cambridge_Bay                  | MST    | -07:00:00  | f
 America/Whitehorse                     | MST    | -07:00:00  | f
 America/Fortaleza                      | -03    | -03:00:00  | f
 America/St_Thomas                      | AST    | -04:00:00  | f
 America/Guatemala                      | CST    | -06:00:00  | f
 America/Rosario                        | -03    | -03:00:00  | f
 America/Manaus                         | -04    | -04:00:00  | f
 America/Matamoros                      | CST    | -06:00:00  | f
 America/Managua                        | CST    | -06:00:00  | f
 America/Guadeloupe                     | AST    | -04:00:00  | f
 America/Jamaica                        | EST    | -05:00:00  | f
 America/Barbados                       | AST    | -04:00:00  | f
 America/Dawson                         | MST    | -07:00:00  | f
 America/Mexico_City                    | CST    | -06:00:00  | f
 America/Tortola                        | AST    | -04:00:00  | f
 America/Nome                           | AKST   | -09:00:00  | f
 America/Glace_Bay                      | AST    | -04:00:00  | f
 America/Eirunepe                       | -05    | -05:00:00  | f
 America/Rio_Branco                     | -05    | -05:00:00  | f
 America/St_Barthelemy                  | AST    | -04:00:00  | f
 America/Creston                        | MST    | -07:00:00  | f
 America/Nipigon                        | EST    | -05:00:00  | f
 America/Phoenix                        | MST    | -07:00:00  | f
 America/Martinique                     | AST    | -04:00:00  | f
 America/Cuiaba                         | -04    | -04:00:00  | f
 America/Mazatlan                       | MST    | -07:00:00  | f
 America/Louisville                     | EST    | -05:00:00  | f
 America/Goose_Bay                      | AST    | -04:00:00  | f
 America/Menominee                      | CST    | -06:00:00  | f
 America/Pangnirtung                    | EST    | -05:00:00  | f
 America/Rainy_River                    | CST    | -06:00:00  | f
 America/Resolute                       | CST    | -06:00:00  | f
 America/Halifax                        | AST    | -04:00:00  | f
 America/Curacao                        | AST    | -04:00:00  | f
 America/Santarem                       | -03    | -03:00:00  | f
 America/Punta_Arenas                   | -03    | -03:00:00  | f
 America/Puerto_Rico                    | AST    | -04:00:00  | f
 America/Dawson_Creek                   | MST    | -07:00:00  | f
 America/Aruba                          | AST    | -04:00:00  | f
 America/Virgin                         | AST    | -04:00:00  | f
 America/Anchorage                      | AKST   | -09:00:00  | f
 America/Sitka                          | AKST   | -09:00:00  | f
 America/North_Dakota/Beulah            | CST    | -06:00:00  | f
 America/North_Dakota/New_Salem         | CST    | -06:00:00  | f
 America/North_Dakota/Center            | CST    | -06:00:00  | f
 America/Montserrat                     | AST    | -04:00:00  | f
 America/Boa_Vista                      | -04    | -04:00:00  | f
 America/Bahia_Banderas                 | CST    | -06:00:00  | f
 America/Montevideo                     | -03    | -03:00:00  | f
 America/Costa_Rica                     | CST    | -06:00:00  | f
 America/Cayman                         | EST    | -05:00:00  | f
 America/Porto_Velho                    | -04    | -04:00:00  | f
 America/Moncton                        | AST    | -04:00:00  | f
 America/Lower_Princes                  | AST    | -04:00:00  | f
 America/Havana                         | CST    | -05:00:00  | f
 America/Lima                           | -05    | -05:00:00  | f
 America/Atka                           | HST    | -10:00:00  | f
 America/Porto_Acre                     | -05    | -05:00:00  | f
 America/Inuvik                         | MST    | -07:00:00  | f
 America/Santiago                       | -03    | -03:00:00  | t
 America/St_Vincent                     | AST    | -04:00:00  | f
 Israel                                 | IST    | 02:00:00   | f
 MST7MDT                                | MST    | -07:00:00  | f
 Africa/Accra                           | GMT    | 00:00:00   | f
 Africa/Malabo                          | WAT    | 01:00:00   | f
 Africa/Kigali                          | CAT    | 02:00:00   | f
 Africa/El_Aaiun                        | +01    | 01:00:00   | f
 Africa/Juba                            | CAT    | 02:00:00   | f
 Africa/Abidjan                         | GMT    | 00:00:00   | f
 Africa/Bujumbura                       | CAT    | 02:00:00   | f
 Africa/Lome                            | GMT    | 00:00:00   | f
 Africa/Dakar                           | GMT    | 00:00:00   | f
 Africa/Dar_es_Salaam                   | EAT    | 03:00:00   | f
 Africa/Asmera                          | EAT    | 03:00:00   | f
 Africa/Mbabane                         | SAST   | 02:00:00   | f
 Africa/Harare                          | CAT    | 02:00:00   | f
 Africa/Freetown                        | GMT    | 00:00:00   | f
 Africa/Tripoli                         | EET    | 02:00:00   | f
 Africa/Conakry                         | GMT    | 00:00:00   | f
 Africa/Monrovia                        | GMT    | 00:00:00   | f
 Africa/Lagos                           | WAT    | 01:00:00   | f
 Africa/Khartoum                        | CAT    | 02:00:00   | f
 Africa/Casablanca                      | +01    | 01:00:00   | f
 Africa/Maseru                          | SAST   | 02:00:00   | f
 Africa/Blantyre                        | CAT    | 02:00:00   | f
 Africa/Cairo                           | EET    | 02:00:00   | f
 Africa/Algiers                         | CET    | 01:00:00   | f
 Africa/Kampala                         | EAT    | 03:00:00   | f
 Africa/Brazzaville                     | WAT    | 01:00:00   | f
 Africa/Douala                          | WAT    | 01:00:00   | f
 Africa/Niamey                          | WAT    | 01:00:00   | f
 Africa/Porto-Novo                      | WAT    | 01:00:00   | f
 Africa/Timbuktu                        | GMT    | 00:00:00   | f
 Africa/Libreville                      | WAT    | 01:00:00   | f
 Africa/Ceuta                           | CET    | 01:00:00   | f
 Africa/Banjul                          | GMT    | 00:00:00   | f
 Africa/Bissau                          | GMT    | 00:00:00   | f
 Africa/Windhoek                        | CAT    | 02:00:00   | f
 Africa/Nouakchott                      | GMT    | 00:00:00   | f
 Africa/Maputo                          | CAT    | 02:00:00   | f
 Africa/Lubumbashi                      | CAT    | 02:00:00   | f
 Africa/Ndjamena                        | WAT    | 01:00:00   | f
 Africa/Nairobi                         | EAT    | 03:00:00   | f
 Africa/Kinshasa                        | WAT    | 01:00:00   | f
 Africa/Bamako                          | GMT    | 00:00:00   | f
 Africa/Asmara                          | EAT    | 03:00:00   | f
 Africa/Lusaka                          | CAT    | 02:00:00   | f
 Africa/Sao_Tome                        | GMT    | 00:00:00   | f
 Africa/Gaborone                        | CAT    | 02:00:00   | f
 Africa/Djibouti                        | EAT    | 03:00:00   | f
 Africa/Luanda                          | WAT    | 01:00:00   | f
 Africa/Tunis                           | CET    | 01:00:00   | f
 Africa/Addis_Ababa                     | EAT    | 03:00:00   | f
 Africa/Ouagadougou                     | GMT    | 00:00:00   | f
 Africa/Johannesburg                    | SAST   | 02:00:00   | f
 Africa/Bangui                          | WAT    | 01:00:00   | f
 Africa/Mogadishu                       | EAT    | 03:00:00   | f
 Asia/Katmandu                          | +0545  | 05:45:00   | f
 Asia/Aden                              | +03    | 03:00:00   | f
 Asia/Srednekolymsk                     | +11    | 11:00:00   | f
 Asia/Tbilisi                           | +04    | 04:00:00   | f
 Asia/Macao                             | CST    | 08:00:00   | f
 Asia/Phnom_Penh                        | +07    | 07:00:00   | f
 Asia/Ujung_Pandang                     | WITA   | 08:00:00   | f
 Asia/Kuala_Lumpur                      | +08    | 08:00:00   | f
 Asia/Krasnoyarsk                       | +07    | 07:00:00   | f
 Asia/Hovd                              | +07    | 07:00:00   | f
 Asia/Baghdad                           | +03    | 03:00:00   | f
 Asia/Vladivostok                       | +10    | 10:00:00   | f
 Asia/Kuwait                            | +03    | 03:00:00   | f
 Asia/Dili                              | +09    | 09:00:00   | f
 Asia/Tomsk                             | +07    | 07:00:00   | f
 Asia/Dhaka                             | +06    | 06:00:00   | f
 Asia/Qyzylorda                         | +05    | 05:00:00   | f
 Asia/Yerevan                           | +04    | 04:00:00   | f
 Asia/Kabul                             | +0430  | 04:30:00   | f
 Asia/Gaza                              | EET    | 02:00:00   | f
 Asia/Kuching                           | +08    | 08:00:00   | f
 Asia/Yangon                            | +0630  | 06:30:00   | f
 Asia/Amman                             | +03    | 03:00:00   | f
 Asia/Taipei                            | CST    | 08:00:00   | f
 Asia/Kathmandu                         | +0545  | 05:45:00   | f
 Asia/Ulaanbaatar                       | +08    | 08:00:00   | f
 Asia/Almaty                            | +06    | 06:00:00   | f
 Asia/Yekaterinburg                     | +05    | 05:00:00   | f
 Asia/Qatar                             | +03    | 03:00:00   | f
 Asia/Barnaul                           | +07    | 07:00:00   | f
 Asia/Anadyr                            | +12    | 12:00:00   | f
 Asia/Makassar                          | WITA   | 08:00:00   | f
 Asia/Istanbul                          | +03    | 03:00:00   | f
 Asia/Rangoon                           | +0630  | 06:30:00   | f
 Asia/Jerusalem                         | IST    | 02:00:00   | f
 Asia/Nicosia                           | EET    | 02:00:00   | f
 Asia/Choibalsan                        | +08    | 08:00:00   | f
 Asia/Famagusta                         | EET    | 02:00:00   | f
 Asia/Atyrau                            | +05    | 05:00:00   | f
 Asia/Karachi                           | PKT    | 05:00:00   | f
 Asia/Riyadh                            | +03    | 03:00:00   | f
 Asia/Muscat                            | +04    | 04:00:00   | f
 Asia/Tashkent                          | +05    | 05:00:00   | f
 Asia/Chungking                         | CST    | 08:00:00   | f
 Asia/Ust-Nera                          | +10    | 10:00:00   | f
 Asia/Hong_Kong                         | HKT    | 08:00:00   | f
 Asia/Bishkek                           | +06    | 06:00:00   | f
 Asia/Samarkand                         | +05    | 05:00:00   | f
 Asia/Dushanbe                          | +05    | 05:00:00   | f
 Asia/Ashgabat                          | +05    | 05:00:00   | f
 Asia/Chongqing                         | CST    | 08:00:00   | f
 Asia/Dubai                             | +04    | 04:00:00   | f
 Asia/Shanghai                          | CST    | 08:00:00   | f
 Asia/Novosibirsk                       | +07    | 07:00:00   | f
 Asia/Chita                             | +09    | 09:00:00   | f
 Asia/Colombo                           | +0530  | 05:30:00   | f
 Asia/Irkutsk                           | +08    | 08:00:00   | f
 Asia/Beirut                            | EET    | 02:00:00   | f
 Asia/Kolkata                           | IST    | 05:30:00   | f
 Asia/Khandyga                          | +09    | 09:00:00   | f
 Asia/Manila                            | PST    | 08:00:00   | f
 Asia/Novokuznetsk                      | +07    | 07:00:00   | f
 Asia/Damascus                          | +03    | 03:00:00   | f
 Asia/Singapore                         | +08    | 08:00:00   | f
 Asia/Sakhalin                          | +11    | 11:00:00   | f
 Asia/Hebron                            | EET    | 02:00:00   | f
 Asia/Dacca                             | +06    | 06:00:00   | f
 Asia/Tel_Aviv                          | IST    | 02:00:00   | f
 Asia/Kashgar                           | +06    | 06:00:00   | f
 Asia/Qostanay                          | +06    | 06:00:00   | f
 Asia/Baku                              | +04    | 04:00:00   | f
 Asia/Kamchatka                         | +12    | 12:00:00   | f
 Asia/Aqtau                             | +05    | 05:00:00   | f
 Asia/Yakutsk                           | +09    | 09:00:00   | f
 Asia/Thimphu                           | +06    | 06:00:00   | f
 Asia/Tokyo                             | JST    | 09:00:00   | f
 Asia/Thimbu                            | +06    | 06:00:00   | f
 Asia/Omsk                              | +06    | 06:00:00   | f
 Asia/Bahrain                           | +03    | 03:00:00   | f
 Asia/Jakarta                           | WIB    | 07:00:00   | f
 Asia/Brunei                            | +08    | 08:00:00   | f
 Asia/Bangkok                           | +07    | 07:00:00   | f
 Asia/Calcutta                          | IST    | 05:30:00   | f
 Asia/Urumqi                            | +06    | 06:00:00   | f
 Asia/Pyongyang                         | KST    | 09:00:00   | f
 Asia/Ho_Chi_Minh                       | +07    | 07:00:00   | f
 Asia/Magadan                           | +11    | 11:00:00   | f
 Asia/Jayapura                          | WIT    | 09:00:00   | f
 Asia/Macau                             | CST    | 08:00:00   | f
 Asia/Pontianak                         | WIB    | 07:00:00   | f
 Asia/Ashkhabad                         | +05    | 05:00:00   | f
 Asia/Aqtobe                            | +05    | 05:00:00   | f
 Asia/Oral                              | +05    | 05:00:00   | f
 Asia/Harbin                            | CST    | 08:00:00   | f
 Asia/Ulan_Bator                        | +08    | 08:00:00   | f
 Asia/Seoul                             | KST    | 09:00:00   | f
 Asia/Vientiane                         | +07    | 07:00:00   | f
 Asia/Saigon                            | +07    | 07:00:00   | f
 Asia/Tehran                            | +0330  | 03:30:00   | f
 posixrules                             | EST    | -05:00:00  | f
 Hongkong                               | HKT    | 08:00:00   | f
 WET                                    | WET    | 00:00:00   | f
 posix/NZ                               | NZDT   | 13:00:00   | t
 posix/GB-Eire                          | GMT    | 00:00:00   | f
 posix/Canada/Yukon                     | MST    | -07:00:00  | f
 posix/Canada/Atlantic                  | AST    | -04:00:00  | f
 posix/Canada/Pacific                   | PST    | -08:00:00  | f
 posix/Canada/Eastern                   | EST    | -05:00:00  | f
 posix/Canada/Central                   | CST    | -06:00:00  | f
 posix/Canada/Saskatchewan              | CST    | -06:00:00  | f
 posix/Canada/Newfoundland              | NST    | -03:30:00  | f
 posix/Canada/Mountain                  | MST    | -07:00:00  | f
 posix/Japan                            | JST    | 09:00:00   | f
 posix/Kwajalein                        | +12    | 12:00:00   | f
 posix/Egypt                            | EET    | 02:00:00   | f
 posix/Poland                           | CET    | 01:00:00   | f
 posix/Turkey                           | +03    | 03:00:00   | f
 posix/CET                              | CET    | 01:00:00   | f
 posix/Brazil/DeNoronha                 | -02    | -02:00:00  | f
 posix/Brazil/East                      | -03    | -03:00:00  | f
 posix/Brazil/West                      | -04    | -04:00:00  | f
 posix/Brazil/Acre                      | -05    | -05:00:00  | f
 posix/Chile/Continental                | -03    | -03:00:00  | t
 posix/Chile/EasterIsland               | -05    | -05:00:00  | t
 posix/EST5EDT                          | EST    | -05:00:00  | f
 posix/Atlantic/Jan_Mayen               | CET    | 01:00:00   | f
 posix/Atlantic/Cape_Verde              | -01    | -01:00:00  | f
 posix/Atlantic/South_Georgia           | -02    | -02:00:00  | f
 posix/Atlantic/Faroe                   | WET    | 00:00:00   | f
 posix/Atlantic/St_Helena               | GMT    | 00:00:00   | f
 posix/Atlantic/Azores                  | -01    | -01:00:00  | f
 posix/Atlantic/Madeira                 | WET    | 00:00:00   | f
 posix/Atlantic/Stanley                 | -03    | -03:00:00  | f
 posix/Atlantic/Bermuda                 | AST    | -04:00:00  | f
 posix/Atlantic/Canary                  | WET    | 00:00:00   | f
 posix/Atlantic/Reykjavik               | GMT    | 00:00:00   | f
 posix/Atlantic/Faeroe                  | WET    | 00:00:00   | f
 posix/Iceland                          | GMT    | 00:00:00   | f
 posix/GMT0                             | GMT    | 00:00:00   | f
 posix/EST                              | EST    | -05:00:00  | f
 posix/PRC                              | CST    | 08:00:00   | f
 posix/Cuba                             | CST    | -05:00:00  | f
 posix/Eire                             | GMT    | 00:00:00   | t
 posix/HST                              | HST    | -10:00:00  | f
 posix/GMT                              | GMT    | 00:00:00   | f
 posix/Greenwich                        | GMT    | 00:00:00   | f
 posix/CST6CDT                          | CST    | -06:00:00  | f
 posix/W-SU                             | MSK    | 03:00:00   | f
 posix/GMT+0                            | GMT    | 00:00:00   | f
 posix/EET                              | EET    | 02:00:00   | f
 posix/Etc/GMT-2                        | +02    | 02:00:00   | f
 posix/Etc/GMT-13                       | +13    | 13:00:00   | f
 posix/Etc/GMT+2                        | -02    | -02:00:00  | f
 posix/Etc/GMT+7                        | -07    | -07:00:00  | f
 posix/Etc/GMT-12                       | +12    | 12:00:00   | f
 posix/Etc/GMT-5                        | +05    | 05:00:00   | f
 posix/Etc/GMT-11                       | +11    | 11:00:00   | f
 posix/Etc/GMT0                         | GMT    | 00:00:00   | f
 posix/Etc/GMT+6                        | -06    | -06:00:00  | f
 posix/Etc/GMT                          | GMT    | 00:00:00   | f
 posix/Etc/Greenwich                    | GMT    | 00:00:00   | f
 posix/Etc/GMT+0                        | GMT    | 00:00:00   | f
 posix/Etc/GMT+4                        | -04    | -04:00:00  | f
 posix/Etc/GMT-6                        | +06    | 06:00:00   | f
 posix/Etc/GMT+11                       | -11    | -11:00:00  | f
 posix/Etc/GMT+8                        | -08    | -08:00:00  | f
 posix/Etc/GMT-8                        | +08    | 08:00:00   | f
 posix/Etc/GMT+3                        | -03    | -03:00:00  | f
 posix/Etc/GMT+5                        | -05    | -05:00:00  | f
 posix/Etc/Universal                    | UTC    | 00:00:00   | f
 posix/Etc/GMT+1                        | -01    | -01:00:00  | f
 posix/Etc/UCT                          | UTC    | 00:00:00   | f
 posix/Etc/GMT+12                       | -12    | -12:00:00  | f
 posix/Etc/GMT-10                       | +10    | 10:00:00   | f
 posix/Etc/GMT-7                        | +07    | 07:00:00   | f
 posix/Etc/GMT-0                        | GMT    | 00:00:00   | f
 posix/Etc/Zulu                         | UTC    | 00:00:00   | f
 posix/Etc/GMT-14                       | +14    | 14:00:00   | f
 posix/Etc/UTC                          | UTC    | 00:00:00   | f
 posix/Etc/GMT-1                        | +01    | 01:00:00   | f
 posix/Etc/GMT+9                        | -09    | -09:00:00  | f
 posix/Etc/GMT-3                        | +03    | 03:00:00   | f
 posix/Etc/GMT-4                        | +04    | 04:00:00   | f
 posix/Etc/GMT+10                       | -10    | -10:00:00  | f
 posix/Etc/GMT-9                        | +09    | 09:00:00   | f
 posix/Pacific/Wake                     | +12    | 12:00:00   | f
 posix/Pacific/Saipan                   | ChST   | 10:00:00   | f
 posix/Pacific/Kwajalein                | +12    | 12:00:00   | f
 posix/Pacific/Chuuk                    | +10    | 10:00:00   | f
 posix/Pacific/Chatham                  | +1345  | 13:45:00   | t
 posix/Pacific/Pitcairn                 | -08    | -08:00:00  | f
 posix/Pacific/Honolulu                 | HST    | -10:00:00  | f
 posix/Pacific/Johnston                 | HST    | -10:00:00  | f
 posix/Pacific/Niue                     | -11    | -11:00:00  | f
 posix/Pacific/Yap                      | +10    | 10:00:00   | f
 posix/Pacific/Guadalcanal              | +11    | 11:00:00   | f
 posix/Pacific/Tarawa                   | +12    | 12:00:00   | f
 posix/Pacific/Palau                    | +09    | 09:00:00   | f
 posix/Pacific/Samoa                    | SST    | -11:00:00  | f
 posix/Pacific/Majuro                   | +12    | 12:00:00   | f
 posix/Pacific/Port_Moresby             | +10    | 10:00:00   | f
 posix/Pacific/Apia                     | +13    | 13:00:00   | f
 posix/Pacific/Truk                     | +10    | 10:00:00   | f
 posix/Pacific/Marquesas                | -0930  | -09:30:00  | f
 posix/Pacific/Efate                    | +11    | 11:00:00   | f
 posix/Pacific/Pago_Pago                | SST    | -11:00:00  | f
 posix/Pacific/Kosrae                   | +11    | 11:00:00   | f
 posix/Pacific/Nauru                    | +12    | 12:00:00   | f
 posix/Pacific/Enderbury                | +13    | 13:00:00   | f
 posix/Pacific/Bougainville             | +11    | 11:00:00   | f
 posix/Pacific/Wallis                   | +12    | 12:00:00   | f
 posix/Pacific/Fakaofo                  | +13    | 13:00:00   | f
 posix/Pacific/Kanton                   | +13    | 13:00:00   | f
 posix/Pacific/Midway                   | SST    | -11:00:00  | f
 posix/Pacific/Tongatapu                | +13    | 13:00:00   | f
 posix/Pacific/Noumea                   | +11    | 11:00:00   | f
 posix/Pacific/Tahiti                   | -10    | -10:00:00  | f
 posix/Pacific/Gambier                  | -09    | -09:00:00  | f
 posix/Pacific/Rarotonga                | -10    | -10:00:00  | f
 posix/Pacific/Pohnpei                  | +11    | 11:00:00   | f
 posix/Pacific/Fiji                     | +12    | 12:00:00   | f
 posix/Pacific/Auckland                 | NZDT   | 13:00:00   | t
 posix/Pacific/Kiritimati               | +14    | 14:00:00   | f
 posix/Pacific/Guam                     | ChST   | 10:00:00   | f
 posix/Pacific/Norfolk                  | +12    | 12:00:00   | t
 posix/Pacific/Galapagos                | -06    | -06:00:00  | f
 posix/Pacific/Easter                   | -05    | -05:00:00  | t
 posix/Pacific/Funafuti                 | +12    | 12:00:00   | f
 posix/Pacific/Ponape                   | +11    | 11:00:00   | f
 posix/ROC                              | CST    | 08:00:00   | f
 posix/Europe/Vaduz                     | CET    | 01:00:00   | f
 posix/Europe/Belfast                   | GMT    | 00:00:00   | f
 posix/Europe/Volgograd                 | +03    | 03:00:00   | f
 posix/Europe/Copenhagen                | CET    | 01:00:00   | f
 posix/Europe/Minsk                     | +03    | 03:00:00   | f
 posix/Europe/Sofia                     | EET    | 02:00:00   | f
 posix/Europe/Warsaw                    | CET    | 01:00:00   | f
 posix/Europe/San_Marino                | CET    | 01:00:00   | f
 posix/Europe/Riga                      | EET    | 02:00:00   | f
 posix/Europe/Kiev                      | EET    | 02:00:00   | f
 posix/Europe/Isle_of_Man               | GMT    | 00:00:00   | f
 posix/Europe/Chisinau                  | EET    | 02:00:00   | f
 posix/Europe/Prague                    | CET    | 01:00:00   | f
 posix/Europe/Brussels                  | CET    | 01:00:00   | f
 posix/Europe/Tiraspol                  | EET    | 02:00:00   | f
 posix/Europe/Podgorica                 | CET    | 01:00:00   | f
 posix/Europe/Guernsey                  | GMT    | 00:00:00   | f
 posix/Europe/Vienna                    | CET    | 01:00:00   | f
 posix/Europe/Sarajevo                  | CET    | 01:00:00   | f
 posix/Europe/Kaliningrad               | EET    | 02:00:00   | f
 posix/Europe/Busingen                  | CET    | 01:00:00   | f
 posix/Europe/Zaporozhye                | EET    | 02:00:00   | f
 posix/Europe/Ljubljana                 | CET    | 01:00:00   | f
 posix/Europe/Bucharest                 | EET    | 02:00:00   | f
 posix/Europe/Berlin                    | CET    | 01:00:00   | f
 posix/Europe/Tallinn                   | EET    | 02:00:00   | f
 posix/Europe/London                    | GMT    | 00:00:00   | f
 posix/Europe/Paris                     | CET    | 01:00:00   | f
 posix/Europe/Amsterdam                 | CET    | 01:00:00   | f
 posix/Europe/Istanbul                  | +03    | 03:00:00   | f
 posix/Europe/Vilnius                   | EET    | 02:00:00   | f
 posix/Europe/Nicosia                   | EET    | 02:00:00   | f
 posix/Europe/Astrakhan                 | +04    | 04:00:00   | f
 posix/Europe/Saratov                   | +04    | 04:00:00   | f
 posix/Europe/Jersey                    | GMT    | 00:00:00   | f
 posix/Europe/Moscow                    | MSK    | 03:00:00   | f
 posix/Europe/Helsinki                  | EET    | 02:00:00   | f
 posix/Europe/Belgrade                  | CET    | 01:00:00   | f
 posix/Europe/Kirov                     | +03    | 03:00:00   | f
 posix/Europe/Kyiv                      | EET    | 02:00:00   | f
 posix/Europe/Gibraltar                 | CET    | 01:00:00   | f
 posix/Europe/Samara                    | +04    | 04:00:00   | f
 posix/Europe/Ulyanovsk                 | +04    | 04:00:00   | f
 posix/Europe/Andorra                   | CET    | 01:00:00   | f
 posix/Europe/Oslo                      | CET    | 01:00:00   | f
 posix/Europe/Uzhgorod                  | EET    | 02:00:00   | f
 posix/Europe/Budapest                  | CET    | 01:00:00   | f
 posix/Europe/Skopje                    | CET    | 01:00:00   | f
 posix/Europe/Mariehamn                 | EET    | 02:00:00   | f
 posix/Europe/Stockholm                 | CET    | 01:00:00   | f
 posix/Europe/Zurich                    | CET    | 01:00:00   | f
 posix/Europe/Zagreb                    | CET    | 01:00:00   | f
 posix/Europe/Monaco                    | CET    | 01:00:00   | f
 posix/Europe/Simferopol                | MSK    | 03:00:00   | f
 posix/Europe/Vatican                   | CET    | 01:00:00   | f
 posix/Europe/Tirane                    | CET    | 01:00:00   | f
 posix/Europe/Madrid                    | CET    | 01:00:00   | f
 posix/Europe/Athens                    | EET    | 02:00:00   | f
 posix/Europe/Dublin                    | GMT    | 00:00:00   | t
 posix/Europe/Malta                     | CET    | 01:00:00   | f
 posix/Europe/Rome                      | CET    | 01:00:00   | f
 posix/Europe/Luxembourg                | CET    | 01:00:00   | f
 posix/Europe/Lisbon                    | WET    | 00:00:00   | f
 posix/Europe/Bratislava                | CET    | 01:00:00   | f
 posix/Navajo                           | MST    | -07:00:00  | f
 posix/PST8PDT                          | PST    | -08:00:00  | f
 posix/ROK                              | KST    | 09:00:00   | f
 posix/Portugal                         | WET    | 00:00:00   | f
 posix/MET                              | MET    | 01:00:00   | f
 posix/Antarctica/McMurdo               | NZDT   | 13:00:00   | t
 posix/Antarctica/Vostok                | +06    | 06:00:00   | f
 posix/Antarctica/South_Pole            | NZDT   | 13:00:00   | t
 posix/Antarctica/Syowa                 | +03    | 03:00:00   | f
 posix/Antarctica/Mawson                | +05    | 05:00:00   | f
 posix/Antarctica/DumontDUrville        | +10    | 10:00:00   | f
 posix/Antarctica/Rothera               | -03    | -03:00:00  | f
 posix/Antarctica/Davis                 | +07    | 07:00:00   | f
 posix/Antarctica/Palmer                | -03    | -03:00:00  | f
 posix/Antarctica/Troll                 | +00    | 00:00:00   | f
 posix/Antarctica/Macquarie             | AEDT   | 11:00:00   | t
 posix/Antarctica/Casey                 | +11    | 11:00:00   | f
 posix/NZ-CHAT                          | +1345  | 13:45:00   | t
 posix/Universal                        | UTC    | 00:00:00   | f
 posix/MST                              | MST    | -07:00:00  | f
 posix/Jamaica                          | EST    | -05:00:00  | f
 posix/UCT                              | UTC    | 00:00:00   | f
 posix/Factory                          | -00    | 00:00:00   | f
 posix/GB                               | GMT    | 00:00:00   | f
 posix/US/Aleutian                      | HST    | -10:00:00  | f
 posix/US/Hawaii                        | HST    | -10:00:00  | f
 posix/US/Arizona                       | MST    | -07:00:00  | f
 posix/US/Indiana-Starke                | CST    | -06:00:00  | f
 posix/US/Pacific                       | PST    | -08:00:00  | f
 posix/US/Samoa                         | SST    | -11:00:00  | f
 posix/US/Michigan                      | EST    | -05:00:00  | f
 posix/US/Eastern                       | EST    | -05:00:00  | f
 posix/US/Central                       | CST    | -06:00:00  | f
 posix/US/Alaska                        | AKST   | -09:00:00  | f
 posix/US/Mountain                      | MST    | -07:00:00  | f
 posix/US/East-Indiana                  | EST    | -05:00:00  | f
 posix/Indian/Chagos                    | +06    | 06:00:00   | f
 posix/Indian/Comoro                    | EAT    | 03:00:00   | f
 posix/Indian/Maldives                  | +05    | 05:00:00   | f
 posix/Indian/Antananarivo              | EAT    | 03:00:00   | f
 posix/Indian/Christmas                 | +07    | 07:00:00   | f
 posix/Indian/Mauritius                 | +04    | 04:00:00   | f
 posix/Indian/Mayotte                   | EAT    | 03:00:00   | f
 posix/Indian/Cocos                     | +0630  | 06:30:00   | f
 posix/Indian/Reunion                   | +04    | 04:00:00   | f
 posix/Indian/Kerguelen                 | +05    | 05:00:00   | f
 posix/Indian/Mahe                      | +04    | 04:00:00   | f
 posix/Singapore                        | +08    | 08:00:00   | f
 posix/GMT-0                            | GMT    | 00:00:00   | f
 posix/Zulu                             | UTC    | 00:00:00   | f
 posix/Australia/Lord_Howe              | +11    | 11:00:00   | t
 posix/Australia/Broken_Hill            | ACDT   | 10:30:00   | t
 posix/Australia/Adelaide               | ACDT   | 10:30:00   | t
 posix/Australia/Sydney                 | AEDT   | 11:00:00   | t
 posix/Australia/Canberra               | AEDT   | 11:00:00   | t
 posix/Australia/NSW                    | AEDT   | 11:00:00   | t
 posix/Australia/Yancowinna             | ACDT   | 10:30:00   | t
 posix/Australia/LHI                    | +11    | 11:00:00   | t
 posix/Australia/West                   | AWST   | 08:00:00   | f
 posix/Australia/South                  | ACDT   | 10:30:00   | t
 posix/Australia/Melbourne              | AEDT   | 11:00:00   | t
 posix/Australia/Eucla                  | +0845  | 08:45:00   | f
 posix/Australia/Tasmania               | AEDT   | 11:00:00   | t
 posix/Australia/Hobart                 | AEDT   | 11:00:00   | t
 posix/Australia/Currie                 | AEDT   | 11:00:00   | t
 posix/Australia/Perth                  | AWST   | 08:00:00   | f
 posix/Australia/ACT                    | AEDT   | 11:00:00   | t
 posix/Australia/Queensland             | AEST   | 10:00:00   | f
 posix/Australia/North                  | ACST   | 09:30:00   | f
 posix/Australia/Lindeman               | AEST   | 10:00:00   | f
 posix/Australia/Darwin                 | ACST   | 09:30:00   | f
 posix/Australia/Brisbane               | AEST   | 10:00:00   | f
 posix/Australia/Victoria               | AEDT   | 11:00:00   | t
 posix/UTC                              | UTC    | 00:00:00   | f
 posix/Libya                            | EET    | 02:00:00   | f
 posix/Arctic/Longyearbyen              | CET    | 01:00:00   | f
 posix/America/Ciudad_Juarez            | MST    | -07:00:00  | f
 posix/America/Ojinaga                  | CST    | -06:00:00  | f
 posix/America/Godthab                  | -03    | -03:00:00  | f
 posix/America/Fort_Nelson              | MST    | -07:00:00  | f
 posix/America/Paramaribo               | -03    | -03:00:00  | f
 posix/America/Sao_Paulo                | -03    | -03:00:00  | f
 posix/America/Campo_Grande             | -04    | -04:00:00  | f
 posix/America/Bahia                    | -03    | -03:00:00  | f
 posix/America/Detroit                  | EST    | -05:00:00  | f
 posix/America/Winnipeg                 | CST    | -06:00:00  | f
 posix/America/Belem                    | -03    | -03:00:00  | f
 posix/America/Boise                    | MST    | -07:00:00  | f
 posix/America/Araguaina                | -03    | -03:00:00  | f
 posix/America/Belize                   | CST    | -06:00:00  | f
 posix/America/Anguilla                 | AST    | -04:00:00  | f
 posix/America/Marigot                  | AST    | -04:00:00  | f
 posix/America/Yakutat                  | AKST   | -09:00:00  | f
 posix/America/Danmarkshavn             | GMT    | 00:00:00   | f
 posix/America/Indianapolis             | EST    | -05:00:00  | f
 posix/America/Maceio                   | -03    | -03:00:00  | f
 posix/America/Caracas                  | -04    | -04:00:00  | f
 posix/America/Swift_Current            | CST    | -06:00:00  | f
 posix/America/Coral_Harbour            | EST    | -05:00:00  | f
 posix/America/El_Salvador              | CST    | -06:00:00  | f
 posix/America/Argentina/San_Luis       | -03    | -03:00:00  | f
 posix/America/Argentina/La_Rioja       | -03    | -03:00:00  | f
 posix/America/Argentina/Jujuy          | -03    | -03:00:00  | f
 posix/America/Argentina/Mendoza        | -03    | -03:00:00  | f
 posix/America/Argentina/Catamarca      | -03    | -03:00:00  | f
 posix/America/Argentina/Buenos_Aires   | -03    | -03:00:00  | f
 posix/America/Argentina/San_Juan       | -03    | -03:00:00  | f
 posix/America/Argentina/Cordoba        | -03    | -03:00:00  | f
 posix/America/Argentina/Rio_Gallegos   | -03    | -03:00:00  | f
 posix/America/Argentina/ComodRivadavia | -03    | -03:00:00  | f
 posix/America/Argentina/Salta          | -03    | -03:00:00  | f
 posix/America/Argentina/Ushuaia        | -03    | -03:00:00  | f
 posix/America/Argentina/Tucuman        | -03    | -03:00:00  | f
 posix/America/Santa_Isabel             | PST    | -08:00:00  | f
 posix/America/Fort_Wayne               | EST    | -05:00:00  | f
 posix/America/St_Kitts                 | AST    | -04:00:00  | f
 posix/America/Juneau                   | AKST   | -09:00:00  | f
 posix/America/Tegucigalpa              | CST    | -06:00:00  | f
 posix/America/Los_Angeles              | PST    | -08:00:00  | f
 posix/America/St_Lucia                 | AST    | -04:00:00  | f
 posix/America/Atikokan                 | EST    | -05:00:00  | f
 posix/America/La_Paz                   | -04    | -04:00:00  | f
 posix/America/Guyana                   | -04    | -04:00:00  | f
 posix/America/Cayenne                  | -03    | -03:00:00  | f
 posix/America/Metlakatla               | AKST   | -09:00:00  | f
 posix/America/Monterrey                | CST    | -06:00:00  | f
 posix/America/Toronto                  | EST    | -05:00:00  | f
 posix/America/Denver                   | MST    | -07:00:00  | f
 posix/America/Kralendijk               | AST    | -04:00:00  | f
 posix/America/Montreal                 | EST    | -05:00:00  | f
 posix/America/Grand_Turk               | EST    | -05:00:00  | f
 posix/America/Hermosillo               | MST    | -07:00:00  | f
 posix/America/Rankin_Inlet             | CST    | -06:00:00  | f
 posix/America/Miquelon                 | -03    | -03:00:00  | f
 posix/America/Jujuy                    | -03    | -03:00:00  | f
 posix/America/Mendoza                  | -03    | -03:00:00  | f
 posix/America/Guayaquil                | -05    | -05:00:00  | f
 posix/America/Port-au-Prince           | EST    | -05:00:00  | f
 posix/America/Nassau                   | EST    | -05:00:00  | f
 posix/America/Panama                   | EST    | -05:00:00  | f
 posix/America/Regina                   | CST    | -06:00:00  | f
 posix/America/Catamarca                | -03    | -03:00:00  | f
 posix/America/Asuncion                 | -03    | -03:00:00  | t
 posix/America/Iqaluit                  | EST    | -05:00:00  | f
 posix/America/Santo_Domingo            | AST    | -04:00:00  | f
 posix/America/Antigua                  | AST    | -04:00:00  | f
 posix/America/Grenada                  | AST    | -04:00:00  | f
 posix/America/Merida                   | CST    | -06:00:00  | f
 posix/America/Buenos_Aires             | -03    | -03:00:00  | f
 posix/America/Nuuk                     | -03    | -03:00:00  | f
 posix/America/Scoresbysund             | -01    | -01:00:00  | f
 posix/America/Chihuahua                | CST    | -06:00:00  | f
 posix/America/Dominica                 | AST    | -04:00:00  | f
 posix/America/Ensenada                 | PST    | -08:00:00  | f
 posix/America/Blanc-Sablon             | AST    | -04:00:00  | f
 posix/America/Adak                     | HST    | -10:00:00  | f
 posix/America/Vancouver                | PST    | -08:00:00  | f
 posix/America/Yellowknife              | MST    | -07:00:00  | f
 posix/America/Edmonton                 | MST    | -07:00:00  | f
 posix/America/Cancun                   | EST    | -05:00:00  | f
 posix/America/Kentucky/Monticello      | EST    | -05:00:00  | f
 posix/America/Kentucky/Louisville      | EST    | -05:00:00  | f
 posix/America/Thunder_Bay              | EST    | -05:00:00  | f
 posix/America/Thule                    | AST    | -04:00:00  | f
 posix/America/Noronha                  | -02    | -02:00:00  | f
 posix/America/Recife                   | -03    | -03:00:00  | f
 posix/America/Port_of_Spain            | AST    | -04:00:00  | f
 posix/America/Chicago                  | CST    | -06:00:00  | f
 posix/America/Bogota                   | -05    | -05:00:00  | f
 posix/America/Indiana/Indianapolis     | EST    | -05:00:00  | f
 posix/America/Indiana/Winamac          | EST    | -05:00:00  | f
 posix/America/Indiana/Marengo          | EST    | -05:00:00  | f
 posix/America/Indiana/Knox             | CST    | -06:00:00  | f
 posix/America/Indiana/Vincennes        | EST    | -05:00:00  | f
 posix/America/Indiana/Petersburg       | EST    | -05:00:00  | f
 posix/America/Indiana/Tell_City        | CST    | -06:00:00  | f
 posix/America/Indiana/Vevay            | EST    | -05:00:00  | f
 posix/America/St_Johns                 | NST    | -03:30:00  | f
 posix/America/Tijuana                  | PST    | -08:00:00  | f
 posix/America/Cordoba                  | -03    | -03:00:00  | f
 posix/America/Knox_IN                  | CST    | -06:00:00  | f
 posix/America/New_York                 | EST    | -05:00:00  | f
 posix/America/Shiprock                 | MST    | -07:00:00  | f
 posix/America/Cambridge_Bay            | MST    | -07:00:00  | f
 posix/America/Whitehorse               | MST    | -07:00:00  | f
 posix/America/Fortaleza                | -03    | -03:00:00  | f
 posix/America/St_Thomas                | AST    | -04:00:00  | f
 posix/America/Guatemala                | CST    | -06:00:00  | f
 posix/America/Rosario                  | -03    | -03:00:00  | f
 posix/America/Manaus                   | -04    | -04:00:00  | f
 posix/America/Matamoros                | CST    | -06:00:00  | f
 posix/America/Managua                  | CST    | -06:00:00  | f
 posix/America/Guadeloupe               | AST    | -04:00:00  | f
 posix/America/Jamaica                  | EST    | -05:00:00  | f
 posix/America/Barbados                 | AST    | -04:00:00  | f
 posix/America/Dawson                   | MST    | -07:00:00  | f
 posix/America/Mexico_City              | CST    | -06:00:00  | f
 posix/America/Tortola                  | AST    | -04:00:00  | f
 posix/America/Nome                     | AKST   | -09:00:00  | f
 posix/America/Glace_Bay                | AST    | -04:00:00  | f
 posix/America/Eirunepe                 | -05    | -05:00:00  | f
 posix/America/Rio_Branco               | -05    | -05:00:00  | f
 posix/America/St_Barthelemy            | AST    | -04:00:00  | f
 posix/America/Creston                  | MST    | -07:00:00  | f
 posix/America/Nipigon                  | EST    | -05:00:00  | f
 posix/America/Phoenix                  | MST    | -07:00:00  | f
 posix/America/Martinique               | AST    | -04:00:00  | f
 posix/America/Cuiaba                   | -04    | -04:00:00  | f
 posix/America/Mazatlan                 | MST    | -07:00:00  | f
 posix/America/Louisville               | EST    | -05:00:00  | f
 posix/America/Goose_Bay                | AST    | -04:00:00  | f
 posix/America/Menominee                | CST    | -06:00:00  | f
 posix/America/Pangnirtung              | EST    | -05:00:00  | f
 posix/America/Rainy_River              | CST    | -06:00:00  | f
 posix/America/Resolute                 | CST    | -06:00:00  | f
 posix/America/Halifax                  | AST    | -04:00:00  | f
 posix/America/Curacao                  | AST    | -04:00:00  | f
 posix/America/Santarem                 | -03    | -03:00:00  | f
 posix/America/Punta_Arenas             | -03    | -03:00:00  | f
 posix/America/Puerto_Rico              | AST    | -04:00:00  | f
 posix/America/Dawson_Creek             | MST    | -07:00:00  | f
 posix/America/Aruba                    | AST    | -04:00:00  | f
 posix/America/Virgin                   | AST    | -04:00:00  | f
 posix/America/Anchorage                | AKST   | -09:00:00  | f
 posix/America/Sitka                    | AKST   | -09:00:00  | f
 posix/America/North_Dakota/Beulah      | CST    | -06:00:00  | f
 posix/America/North_Dakota/New_Salem   | CST    | -06:00:00  | f
 posix/America/North_Dakota/Center      | CST    | -06:00:00  | f
 posix/America/Montserrat               | AST    | -04:00:00  | f
 posix/America/Boa_Vista                | -04    | -04:00:00  | f
 posix/America/Bahia_Banderas           | CST    | -06:00:00  | f
 posix/America/Montevideo               | -03    | -03:00:00  | f
 posix/America/Costa_Rica               | CST    | -06:00:00  | f
 posix/America/Cayman                   | EST    | -05:00:00  | f
 posix/America/Porto_Velho              | -04    | -04:00:00  | f
 posix/America/Moncton                  | AST    | -04:00:00  | f
 posix/America/Lower_Princes            | AST    | -04:00:00  | f
 posix/America/Havana                   | CST    | -05:00:00  | f
 posix/America/Lima                     | -05    | -05:00:00  | f
 posix/America/Atka                     | HST    | -10:00:00  | f
 posix/America/Porto_Acre               | -05    | -05:00:00  | f
 posix/America/Inuvik                   | MST    | -07:00:00  | f
 posix/America/Santiago                 | -03    | -03:00:00  | t
 posix/America/St_Vincent               | AST    | -04:00:00  | f
 posix/Israel                           | IST    | 02:00:00   | f
 posix/MST7MDT                          | MST    | -07:00:00  | f
 posix/Africa/Accra                     | GMT    | 00:00:00   | f
 posix/Africa/Malabo                    | WAT    | 01:00:00   | f
 posix/Africa/Kigali                    | CAT    | 02:00:00   | f
 posix/Africa/El_Aaiun                  | +01    | 01:00:00   | f
 posix/Africa/Juba                      | CAT    | 02:00:00   | f
 posix/Africa/Abidjan                   | GMT    | 00:00:00   | f
 posix/Africa/Bujumbura                 | CAT    | 02:00:00   | f
 posix/Africa/Lome                      | GMT    | 00:00:00   | f
 posix/Africa/Dakar                     | GMT    | 00:00:00   | f
 posix/Africa/Dar_es_Salaam             | EAT    | 03:00:00   | f
 posix/Africa/Asmera                    | EAT    | 03:00:00   | f
 posix/Africa/Mbabane                   | SAST   | 02:00:00   | f
 posix/Africa/Harare                    | CAT    | 02:00:00   | f
 posix/Africa/Freetown                  | GMT    | 00:00:00   | f
 posix/Africa/Tripoli                   | EET    | 02:00:00   | f
 posix/Africa/Conakry                   | GMT    | 00:00:00   | f
 posix/Africa/Monrovia                  | GMT    | 00:00:00   | f
 posix/Africa/Lagos                     | WAT    | 01:00:00   | f
 posix/Africa/Khartoum                  | CAT    | 02:00:00   | f
 posix/Africa/Casablanca                | +01    | 01:00:00   | f
 posix/Africa/Maseru                    | SAST   | 02:00:00   | f
 posix/Africa/Blantyre                  | CAT    | 02:00:00   | f
 posix/Africa/Cairo                     | EET    | 02:00:00   | f
 posix/Africa/Algiers                   | CET    | 01:00:00   | f
 posix/Africa/Kampala                   | EAT    | 03:00:00   | f
 posix/Africa/Brazzaville               | WAT    | 01:00:00   | f
 posix/Africa/Douala                    | WAT    | 01:00:00   | f
 posix/Africa/Niamey                    | WAT    | 01:00:00   | f
 posix/Africa/Porto-Novo                | WAT    | 01:00:00   | f
 posix/Africa/Timbuktu                  | GMT    | 00:00:00   | f
 posix/Africa/Libreville                | WAT    | 01:00:00   | f
 posix/Africa/Ceuta                     | CET    | 01:00:00   | f
 posix/Africa/Banjul                    | GMT    | 00:00:00   | f
 posix/Africa/Bissau                    | GMT    | 00:00:00   | f
 posix/Africa/Windhoek                  | CAT    | 02:00:00   | f
 posix/Africa/Nouakchott                | GMT    | 00:00:00   | f
 posix/Africa/Maputo                    | CAT    | 02:00:00   | f
 posix/Africa/Lubumbashi                | CAT    | 02:00:00   | f
 posix/Africa/Ndjamena                  | WAT    | 01:00:00   | f
 posix/Africa/Nairobi                   | EAT    | 03:00:00   | f
 posix/Africa/Kinshasa                  | WAT    | 01:00:00   | f
 posix/Africa/Bamako                    | GMT    | 00:00:00   | f
 posix/Africa/Asmara                    | EAT    | 03:00:00   | f
 posix/Africa/Lusaka                    | CAT    | 02:00:00   | f
 posix/Africa/Sao_Tome                  | GMT    | 00:00:00   | f
 posix/Africa/Gaborone                  | CAT    | 02:00:00   | f
 posix/Africa/Djibouti                  | EAT    | 03:00:00   | f
 posix/Africa/Luanda                    | WAT    | 01:00:00   | f
 posix/Africa/Tunis                     | CET    | 01:00:00   | f
 posix/Africa/Addis_Ababa               | EAT    | 03:00:00   | f
 posix/Africa/Ouagadougou               | GMT    | 00:00:00   | f
 posix/Africa/Johannesburg              | SAST   | 02:00:00   | f
 posix/Africa/Bangui                    | WAT    | 01:00:00   | f
 posix/Africa/Mogadishu                 | EAT    | 03:00:00   | f
 posix/Asia/Katmandu                    | +0545  | 05:45:00   | f
 posix/Asia/Aden                        | +03    | 03:00:00   | f
 posix/Asia/Srednekolymsk               | +11    | 11:00:00   | f
 posix/Asia/Tbilisi                     | +04    | 04:00:00   | f
 posix/Asia/Macao                       | CST    | 08:00:00   | f
 posix/Asia/Phnom_Penh                  | +07    | 07:00:00   | f
 posix/Asia/Ujung_Pandang               | WITA   | 08:00:00   | f
 posix/Asia/Kuala_Lumpur                | +08    | 08:00:00   | f
 posix/Asia/Krasnoyarsk                 | +07    | 07:00:00   | f
 posix/Asia/Hovd                        | +07    | 07:00:00   | f
 posix/Asia/Baghdad                     | +03    | 03:00:00   | f
 posix/Asia/Vladivostok                 | +10    | 10:00:00   | f
 posix/Asia/Kuwait                      | +03    | 03:00:00   | f
 posix/Asia/Dili                        | +09    | 09:00:00   | f
 posix/Asia/Tomsk                       | +07    | 07:00:00   | f
 posix/Asia/Dhaka                       | +06    | 06:00:00   | f
 posix/Asia/Qyzylorda                   | +05    | 05:00:00   | f
 posix/Asia/Yerevan                     | +04    | 04:00:00   | f
 posix/Asia/Kabul                       | +0430  | 04:30:00   | f
 posix/Asia/Gaza                        | EET    | 02:00:00   | f
 posix/Asia/Kuching                     | +08    | 08:00:00   | f
 posix/Asia/Yangon                      | +0630  | 06:30:00   | f
 posix/Asia/Amman                       | +03    | 03:00:00   | f
 posix/Asia/Taipei                      | CST    | 08:00:00   | f
 posix/Asia/Kathmandu                   | +0545  | 05:45:00   | f
 posix/Asia/Ulaanbaatar                 | +08    | 08:00:00   | f
 posix/Asia/Almaty                      | +06    | 06:00:00   | f
 posix/Asia/Yekaterinburg               | +05    | 05:00:00   | f
 posix/Asia/Qatar                       | +03    | 03:00:00   | f
 posix/Asia/Barnaul                     | +07    | 07:00:00   | f
 posix/Asia/Anadyr                      | +12    | 12:00:00   | f
 posix/Asia/Makassar                    | WITA   | 08:00:00   | f
 posix/Asia/Istanbul                    | +03    | 03:00:00   | f
 posix/Asia/Rangoon                     | +0630  | 06:30:00   | f
 posix/Asia/Jerusalem                   | IST    | 02:00:00   | f
 posix/Asia/Nicosia                     | EET    | 02:00:00   | f
 posix/Asia/Choibalsan                  | +08    | 08:00:00   | f
 posix/Asia/Famagusta                   | EET    | 02:00:00   | f
 posix/Asia/Atyrau                      | +05    | 05:00:00   | f
 posix/Asia/Karachi                     | PKT    | 05:00:00   | f
 posix/Asia/Riyadh                      | +03    | 03:00:00   | f
 posix/Asia/Muscat                      | +04    | 04:00:00   | f
 posix/Asia/Tashkent                    | +05    | 05:00:00   | f
 posix/Asia/Chungking                   | CST    | 08:00:00   | f
 posix/Asia/Ust-Nera                    | +10    | 10:00:00   | f
 posix/Asia/Hong_Kong                   | HKT    | 08:00:00   | f
 posix/Asia/Bishkek                     | +06    | 06:00:00   | f
 posix/Asia/Samarkand                   | +05    | 05:00:00   | f
 posix/Asia/Dushanbe                    | +05    | 05:00:00   | f
 posix/Asia/Ashgabat                    | +05    | 05:00:00   | f
 posix/Asia/Chongqing                   | CST    | 08:00:00   | f
 posix/Asia/Dubai                       | +04    | 04:00:00   | f
 posix/Asia/Shanghai                    | CST    | 08:00:00   | f
 posix/Asia/Novosibirsk                 | +07    | 07:00:00   | f
 posix/Asia/Chita                       | +09    | 09:00:00   | f
 posix/Asia/Colombo                     | +0530  | 05:30:00   | f
 posix/Asia/Irkutsk                     | +08    | 08:00:00   | f
 posix/Asia/Beirut                      | EET    | 02:00:00   | f
 posix/Asia/Kolkata                     | IST    | 05:30:00   | f
 posix/Asia/Khandyga                    | +09    | 09:00:00   | f
 posix/Asia/Manila                      | PST    | 08:00:00   | f
 posix/Asia/Novokuznetsk                | +07    | 07:00:00   | f
 posix/Asia/Damascus                    | +03    | 03:00:00   | f
 posix/Asia/Singapore                   | +08    | 08:00:00   | f
 posix/Asia/Sakhalin                    | +11    | 11:00:00   | f
 posix/Asia/Hebron                      | EET    | 02:00:00   | f
 posix/Asia/Dacca                       | +06    | 06:00:00   | f
 posix/Asia/Tel_Aviv                    | IST    | 02:00:00   | f
 posix/Asia/Kashgar                     | +06    | 06:00:00   | f
 posix/Asia/Qostanay                    | +06    | 06:00:00   | f
 posix/Asia/Baku                        | +04    | 04:00:00   | f
 posix/Asia/Kamchatka                   | +12    | 12:00:00   | f
 posix/Asia/Aqtau                       | +05    | 05:00:00   | f
 posix/Asia/Yakutsk                     | +09    | 09:00:00   | f
 posix/Asia/Thimphu                     | +06    | 06:00:00   | f
 posix/Asia/Tokyo                       | JST    | 09:00:00   | f
 posix/Asia/Thimbu                      | +06    | 06:00:00   | f
 posix/Asia/Omsk                        | +06    | 06:00:00   | f
 posix/Asia/Bahrain                     | +03    | 03:00:00   | f
 posix/Asia/Jakarta                     | WIB    | 07:00:00   | f
 posix/Asia/Brunei                      | +08    | 08:00:00   | f
 posix/Asia/Bangkok                     | +07    | 07:00:00   | f
 posix/Asia/Calcutta                    | IST    | 05:30:00   | f
 posix/Asia/Urumqi                      | +06    | 06:00:00   | f
 posix/Asia/Pyongyang                   | KST    | 09:00:00   | f
 posix/Asia/Ho_Chi_Minh                 | +07    | 07:00:00   | f
 posix/Asia/Magadan                     | +11    | 11:00:00   | f
 posix/Asia/Jayapura                    | WIT    | 09:00:00   | f
 posix/Asia/Macau                       | CST    | 08:00:00   | f
 posix/Asia/Pontianak                   | WIB    | 07:00:00   | f
 posix/Asia/Ashkhabad                   | +05    | 05:00:00   | f
 posix/Asia/Aqtobe                      | +05    | 05:00:00   | f
 posix/Asia/Oral                        | +05    | 05:00:00   | f
 posix/Asia/Harbin                      | CST    | 08:00:00   | f
 posix/Asia/Ulan_Bator                  | +08    | 08:00:00   | f
 posix/Asia/Seoul                       | KST    | 09:00:00   | f
 posix/Asia/Vientiane                   | +07    | 07:00:00   | f
 posix/Asia/Saigon                      | +07    | 07:00:00   | f
 posix/Asia/Tehran                      | +0330  | 03:30:00   | f
 posix/Hongkong                         | HKT    | 08:00:00   | f
 posix/WET                              | WET    | 00:00:00   | f
 posix/Mexico/BajaSur                   | MST    | -07:00:00  | f
 posix/Mexico/BajaNorte                 | PST    | -08:00:00  | f
 posix/Mexico/General                   | CST    | -06:00:00  | f
 posix/Iran                             | +0330  | 03:30:00   | f
 Mexico/BajaSur                         | MST    | -07:00:00  | f
 Mexico/BajaNorte                       | PST    | -08:00:00  | f
 Mexico/General                         | CST    | -06:00:00  | f
 Iran                                   | +0330  | 03:30:00   | f
(1195 rows)


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17 19:49                       ` Ihor Radchenko
@ 2023-01-18 16:21                         ` Jean Louis
  0 siblings, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-18 16:21 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Max Nikulin, emacs-orgmode

* Ihor Radchenko <yantar92@posteo.net> [2023-01-17 22:51]:
> Some good news is that all the above edge cases would equally affect the
> current Org's timestamp handling code. Yet, we have no bug reports in
> this area. I'd even go further and say that we should not try hard to
> make things 100% accurate: (1) it will waste a lot of resources; (2)
> users dealing with these edge cases are likely already accustomed to
> most programs not handling things correctly for their special time zone
> situations.

Org shall not handle that, only conversion between Emacs Lisp and
system functions.

Any maintenance shall be done on underlying level of system functions.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* [SOLUTION] Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17 17:40                 ` Max Nikulin
  2023-01-18  9:59                   ` Ihor Radchenko
@ 2023-01-18 16:24                   ` Jean Louis
  1 sibling, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-18 16:24 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Just leave it out and let Org be single user, single time zone system.

You can't make the impossible. It is not database for sensitive work.

Let it be text.

If they want to convert to their time zone, let them do the home work.

If they don't want to use Org for timestamps, like me, let them be.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18  9:59                   ` Ihor Radchenko
@ 2023-01-18 16:25                     ` Jean Louis
  0 siblings, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-18 16:25 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Max Nikulin, emacs-orgmode

* Ihor Radchenko <yantar92@posteo.net> [2023-01-18 13:01]:
> Max Nikulin <manikulin@gmail.com> writes:
> 
> > ... I am unsure concerning Windows, it may have an option of quite 
> > similar variant. That is why I am not sure to which degree Org should be 
> > liberal in respect to various time zones.
> 
> May we just support whatever TZ supports (POSIX)?

Yes, not too much. It is impossible.

I would say this way, if user does not like Org task management
without time zones, go and find other one without Org. Simple.

Org does not have foundation where you can even think of complexities
discussed here.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17  9:45                                 ` Tim Cross
  2023-01-18  9:15                                   ` Ihor Radchenko
@ 2023-01-18 17:09                                   ` Max Nikulin
  1 sibling, 0 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-18 17:09 UTC (permalink / raw)
  To: emacs-orgmode

On 17/01/2023 16:45, Tim Cross wrote:
> Ihor Radchenko <yantar92@posteo.net> writes:
> 
>> Tim Cross <theophilusx@gmail.com> writes:
>>
>>> It also seems that the solution will need some mechanism (possibly on a
>>> per time stamp basis) for the user to specify what should happen when
>>> either the time zone has a daylight savings transition, when the
>>> timezone rules change or when the user's 'default' time zone changes
>>> because they have changed locations.
>>
>> Could you please elaborate here?
> 
> I have some meetings scheduled in my org files which show up in the
> agenda.
> 
> Meeting 1 is a reoccurring meeting which happens every 2 weeks.
> When we
> transition into/out of daylight savings time, I don't want the timestamp
> to change. THe meeting will remain at 3pm.

You specify time zone (globally, for the file, for the subtree, or for 
the particular timestamp) using IANA ID (e.g. Australia/Canberra)

TZ=Australia/Canberra date -d "15:00" '+%F %a %T %z %Z'
2023-01-19 Thu 15:00:00 +1100 AEDT

TZ=Australia/Canberra date -d "+6 month 15:00" '+%F %a %T %z %Z'
2023-07-19 Wed 15:00:00 +1000 AEST

> Meeting 2. This is also a reoccuring meeting. However, this meeting is
> with people from a number of idfferent time zones. When my timezone
> moves into or out of daylight savings time, I need the meeting time to
> be updated - moved forward/back 1 hour.

You either specify time offset or a timezone with fixed offset

TZ=Australia/Canberra date -d "09:00 +0500" '+%F %a %T %z %Z'
2023-01-19 Thu 15:00:00 +1100 AEDT

TZ=Australia/Canberra date -d "+6month 09:00 +0500" '+%F %a %T %z %Z'
2023-07-19 Wed 14:00:00 +1000 AEST

TZ=Australia/Canberra date -d 'TZ="Etc/GMT-5" 09:00' '+%F %a %T %z %Z'
2023-01-18 Wed 15:00:00 +1100 AEDT

TZ=Australia/Canberra date -d 'TZ="Etc/GMT-5" +6month 09:00' '+%F %a %T 
%z %Z'
2023-07-18 Tue 14:00:00 +1000 AEST

> Next week, I'm travelling to a different city for work and will be in a
> different timezone. I need all my meetings to be adjusted except for
> those I've already booked that are in the timezone I willl be in while
> I'm away.

You specify that you original time zone e.g. Australia/Canberra, since 
2023-01-25 15:00 +0100 Europe/Berlin should be used and that agenda 
should be presented in either the "time zome" following you, or some 
fixed one (Australia/Canberra, Europe/Berlin, or Asia/Singapore)




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18 12:02                                       ` Ihor Radchenko
@ 2023-01-18 21:16                                         ` Tim Cross
  2023-01-19  5:29                                           ` Jean Louis
                                                             ` (2 more replies)
  0 siblings, 3 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-18 21:16 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Daryl Manning, rjhorn, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Tim Cross <theophilusx@gmail.com> writes:
>
>>> Does it sound good enough?
>>
>> No, I'm afraid not. How does org distinguish between meeting 1 and
>> meeting 2? IN meeting one, when the timezone transitions in/out of
>> daylight savings, nothing needs to change, but in meeting 2, when this
>> occurs, the meeting needs to be re-sechduled so that it keeps the same
>> offset relative to UTC.
>> Some mechanism is needed so that the user can
>> identify timestamps like those fo rmeeting 1 from those for meeting
>> 2. My idea was to have meeting 1 type timestamps without TZ info and
>> meeting 2 require fully qualified TZ info. However, while this would
>> probably work, I don't like it because it isn't explicit and would be
>> prone to errors.
>
> I still don't understand.
>
> In Org, you will have a default time zone that will be used to build the
> agenda.
>
> In meeting 1, you set the time zone to your local zone
> In meeting 2, you set the time zone to the time zone where the meeting
> is scheduled.
>
> The, both the meetings will be first converted to the default time zone
> and appear in your agenda adjusted as required.

The problem is with meeting 2 and the assumption there is a definitive
timezone for the meeting.

Consider this scenario. I have a meeting with two other people. We are
all in different timezone. What is the timezone of the meeting?

Thinking more about it, in this situation, you probably just need to set the meeting time to UTC
and that would work. However, we would want some easy way to set this
when creating the timestamp (and that could be all that is needed - a
good enhancement to the interface to make it easy to set the timezone)
and good control over how values are displayed in the agenda and org
files (i.e. I imagine you might want a default where they are all shown
in your local time, but similar to working with links, the ability to
display the 'raw' version for editing and other purposes).

As yuou mentioned in another thread, it is likely many of these
scenarios can be adequately managed with good TZ support. It will be
critical that we also have a good UI for setting/adding TZ
information. Then, as you pointed out elsewhere, we will just need good
documentation/tutorials as some of these workflows are not terribly
intuitive and people find this stuff confusing. 


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18  9:29                       ` Ihor Radchenko
  2023-01-18 16:11                         ` Jean Louis
@ 2023-01-18 21:31                         ` Tim Cross
  2023-01-19 10:40                           ` Ihor Radchenko
  1 sibling, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-18 21:31 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Jean Louis, Daryl Manning, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Jean Louis <bugs@gnu.support> writes:
>
>> ...
>> Should be part of C library to observe those things.
>
> Sure. My previous proposals are all relying on `encode-time' which uses
> time.h from system libraries and utilizing TZDB that is taking care
> about all this insanity.
>
> We, however, might need to be careful about applying date increments. In
> `org-read-date' and `org-timestamp-change', which are implemented in
> Elisp without considering these complexities. (maybe also other
> functions; these are just the ones I can think about)
>
> What should we do when:
>
> 1. It is close to DST transition 2:59 -> 2:00 -> 2:01 -> ... -> 2:59 -> 3:00
>    and the users asks to create a timestamp +1h from now
>    or, worse, a timestamp +1h from now in a different time zone
>
> 2. A user asks +1w date shift and the time zone has a 1-day jump during DST?
>    what about +7d? +1d?
>
> 3. What will be +1d 2:30am timestamp refer to when there DST transition
>    as in (1)?

Yep, these are exactly the sorts of issues I was worried about wrt
adding time zone support. Challenge here is I'm not sure there is one
right answer. It will depend on individual use cases. I guess the best
we can do is select what seems to be the most 'sane' approach and
document th elimitations (and possibly how to work around them). The key
is likely to avoid user surprise. Limitations are often better accepted
when flagged up front and when 'discovered' later.

Initially, my thoughts on the 3 above are "I have no clue what the sane
default is" - all options seem to have equal pros and cons. Guess the
best we can do is go with the simplest solution and 'suck it and see". 


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18 21:16                                         ` Tim Cross
@ 2023-01-19  5:29                                           ` Jean Louis
  2023-01-19  6:25                                             ` Thomas S. Dye
  2023-01-19  7:23                                             ` Tim Cross
  2023-01-19 10:35                                           ` [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Ihor Radchenko
  2023-01-19 17:57                                           ` Alexander Adolf
  2 siblings, 2 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-19  5:29 UTC (permalink / raw)
  To: Tim Cross; +Cc: Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

* Tim Cross <theophilusx@gmail.com> [2023-01-19 00:31]:
> The problem is with meeting 2 and the assumption there is a definitive
> timezone for the meeting.
> 
> Consider this scenario. I have a meeting with two other people. We are
> all in different timezone. What is the timezone of the meeting?

Org in this state can't handle such things.

A person in any timezone shall be able to see that time in his local
time zone if we speak of distant meetings, and in case of face to face
meetings, that person shall have computer aid to show him the meeting
time in any time zone that user is located, during travel and upon
arrival to face to face meeting. 

User is supposed to be assisted by computer. And not to assist to
computer, or to get troubles from computer.

- Time zone shall be more or less recognizable by city and country. 

- User addresses in the address book shall be part of every computer system

- It is natural and common sense to know addresses of people one wants
  to meet

- By using location of person one wants to meet, computer has got
  enough information for representation of the time zone

- By sharing appointment record to user in other time zone, that user
  would see it in his time zone, or by choice in original time zone of
  the meeting place

A record of time, shall have two attributes, the UTC time and the time
zone to be displayed. By using system time zone setting, Org file time
zone settings, heading time zone settings or time stamp time zone
setting, any export of Org shall contain (by user's option) the
desired representation of time stamps.

Function of sharing of meetings shall ask local user:

- is user in different time zone? 

And then by choice of the user's location, the time representation
shall be prepared in such way that both parties understand each other.

That is really not in the sphere of Org where there is not even a
decent address book available.

Just re-write the time by hand for your friend at other part of the
world, write the timestamp in his time zone and your time zone, and
problem solved.

It is supposed to be text. It is not God.

--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19  5:29                                           ` Jean Louis
@ 2023-01-19  6:25                                             ` Thomas S. Dye
  2023-01-19 14:17                                               ` Jean Louis
  2023-01-19  7:23                                             ` Tim Cross
  1 sibling, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-19  6:25 UTC (permalink / raw)
  To: Jean Louis
  Cc: Tim Cross, Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

Aloha all,

Jean Louis <bugs@gnu.support> writes:

> * Tim Cross <theophilusx@gmail.com> [2023-01-19 00:31]:
>> The problem is with meeting 2 and the assumption there is a 
>> definitive
>> timezone for the meeting.
>> 
>> Consider this scenario. I have a meeting with two other people. 
>> We are
>> all in different timezone. What is the timezone of the meeting?

Meetings are occurrences, which require absolute time, which has 
no timezones.  Org should record occurrences with timestamps in 
UTC, possibly translating from the user's local time.

>
> Org in this state can't handle such things.

Org can do the useful thing: translate the UTC timestamp into 
local time and report both UTC and local time.  User will be able 
quickly to determine if local time is incorrect for some reason, 
such as DST or travel.

Storing timestamps in UTC solves the interval problem Ihor raised. 
Intervals always make sense in absolute time.  Moving them to 
event time leads to the insanity Ihor mentioned.

hth,
Tom

>
> A person in any timezone shall be able to see that time in his 
> local
> time zone if we speak of distant meetings, and in case of face 
> to face
> meetings, that person shall have computer aid to show him the 
> meeting
> time in any time zone that user is located, during travel and 
> upon
> arrival to face to face meeting. 
>
> User is supposed to be assisted by computer. And not to assist 
> to
> computer, or to get troubles from computer.
>
> - Time zone shall be more or less recognizable by city and 
> country. 
>
> - User addresses in the address book shall be part of every 
> computer system
>
> - It is natural and common sense to know addresses of people one 
> wants
>   to meet
>
> - By using location of person one wants to meet, computer has 
> got
>   enough information for representation of the time zone
>
> - By sharing appointment record to user in other time zone, that 
> user
>   would see it in his time zone, or by choice in original time 
>   zone of
>   the meeting place
>
> A record of time, shall have two attributes, the UTC time and 
> the time
> zone to be displayed. By using system time zone setting, Org 
> file time
> zone settings, heading time zone settings or time stamp time 
> zone
> setting, any export of Org shall contain (by user's option) the
> desired representation of time stamps.
>
> Function of sharing of meetings shall ask local user:
>
> - is user in different time zone? 
>
> And then by choice of the user's location, the time 
> representation
> shall be prepared in such way that both parties understand each 
> other.
>
> That is really not in the sphere of Org where there is not even 
> a
> decent address book available.
>
> Just re-write the time by hand for your friend at other part of 
> the
> world, write the timestamp in his time zone and your time zone, 
> and
> problem solved.
>
> It is supposed to be text. It is not God.


-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19  5:29                                           ` Jean Louis
  2023-01-19  6:25                                             ` Thomas S. Dye
@ 2023-01-19  7:23                                             ` Tim Cross
  2023-01-19 14:32                                               ` Jean Louis
  1 sibling, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-19  7:23 UTC (permalink / raw)
  To: Jean Louis; +Cc: Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

> * Tim Cross <theophilusx@gmail.com> [2023-01-19 00:31]:
>> The problem is with meeting 2 and the assumption there is a definitive
>> timezone for the meeting.
>> 
>> Consider this scenario. I have a meeting with two other people. We are
>> all in different timezone. What is the timezone of the meeting?
>
> Org in this state can't handle such things.
>
> A person in any timezone shall be able to see that time in his local
> time zone if we speak of distant meetings, and in case of face to face
> meetings, that person shall have computer aid to show him the meeting
> time in any time zone that user is located, during travel and upon
> arrival to face to face meeting. 
>
> User is supposed to be assisted by computer. And not to assist to
> computer, or to get troubles from computer.
>
> - Time zone shall be more or less recognizable by city and country. 
>
> - User addresses in the address book shall be part of every computer system
>
> - It is natural and common sense to know addresses of people one wants
>   to meet
>
> - By using location of person one wants to meet, computer has got
>   enough information for representation of the time zone
>
> - By sharing appointment record to user in other time zone, that user
>   would see it in his time zone, or by choice in original time zone of
>   the meeting place
>
> A record of time, shall have two attributes, the UTC time and the time
> zone to be displayed. By using system time zone setting, Org file time
> zone settings, heading time zone settings or time stamp time zone
> setting, any export of Org shall contain (by user's option) the
> desired representation of time stamps.
>
> Function of sharing of meetings shall ask local user:
>
> - is user in different time zone? 
>
> And then by choice of the user's location, the time representation
> shall be prepared in such way that both parties understand each other.
>
> That is really not in the sphere of Org where there is not even a
> decent address book available.
>
> Just re-write the time by hand for your friend at other part of the
> world, write the timestamp in his time zone and your time zone, and
> problem solved.
>
> It is supposed to be text. It is not God.

You completely misunderstood the specific issue being discussed. You
clearly have not been following this specific point being discussed and
your long reply just confuses matters rather than helps.

This issue is in dealing with the meeting time when the local timezone
changes due to daylight savings time and the fact you have two different
requirements

1. For meeting where all people are in the same timezone, a transition
in/out of daylight savings changes nothing. The meeting time stays the same

2. For meetings wiht people from different time zones, when daylight
savings transition occurs, the timestamp needs to be changed.  Nothing
needs to happen for the people in other time zones - it isn't their
problem and their meeting time is not affected.

Ihor['s suggested solution was to just use the TZ of the 'meeting', but
that is ambiguous. A meeting doesn't have a time zone and picking just
one of the recipients doens't help as now you just have the issues of
their daylight savings transitions etc.

The 'solution' is to record this meeting in UTC tz. However, to make
this 'workable' for most people, the interface for managing timestamps
needs to make this easy.

For example, I would probablyh want an interface where by default, my
timestamps have no TZ data, but if I call the command to add a timestamp
with the universal argument, it will add a default tz and allow me to
easily change it to a different one.

My default 'no tz data' choice is best for me because I don't travel
much and am rarely in different time zones. Therefore, tz data not
needed and the smaller and easier to read/edit timestamps are
preferred. If on the other hand I was someone who travelled a lot, then
I would want the default to be to add full time zone information to
timestamps (though, I would probably want an overlay or similar to
display the timestamps in a more concise format converted to current
tz).


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18 21:16                                         ` Tim Cross
  2023-01-19  5:29                                           ` Jean Louis
@ 2023-01-19 10:35                                           ` Ihor Radchenko
  2023-01-19 17:57                                           ` Alexander Adolf
  2 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-19 10:35 UTC (permalink / raw)
  To: Tim Cross; +Cc: Daryl Manning, rjhorn, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> Consider this scenario. I have a meeting with two other people. We are
> all in different timezone. What is the timezone of the meeting?

You need to come to an agreement about when to do the meeting. Be it
your TZ, and other participant's TZ, or some other fixed TZ (including
UTC or offsets from it).

> ... we would want some easy way to set this
> when creating the timestamp (and that could be all that is needed - a
> good enhancement to the interface to make it easy to set the timezone)
> and good control over how values are displayed in the agenda and org
> files (i.e. I imagine you might want a default where they are all shown
> in your local time, but similar to working with links, the ability to
> display the 'raw' version for editing and other purposes).

`org-read-date' should definitely be extended to understand time zones.
As for the display, we have `org-display-custom-times'. Might need to
extend it in future, but maybe the existing functionality is already
good enough.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18 21:31                         ` Tim Cross
@ 2023-01-19 10:40                           ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-19 10:40 UTC (permalink / raw)
  To: Tim Cross; +Cc: Jean Louis, Daryl Manning, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> Initially, my thoughts on the 3 above are "I have no clue what the sane
> default is" - all options seem to have equal pros and cons. Guess the
> best we can do is go with the simplest solution and 'suck it and see". 

I am leaning towards this approach.
We already do things like

<2023-01-31 Thu +1m> -> <2023-03-03 Fri +1m>

and people are OK with it, seemingly.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18 16:07                 ` Jean Louis
@ 2023-01-19 10:43                   ` Ihor Radchenko
  2023-01-19 14:37                     ` Jean Louis
  0 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-19 10:43 UTC (permalink / raw)
  To: Jean Louis; +Cc: Tim Cross, Daryl Manning, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

> Today I was writing offers where I specified en_US time format, and
> where I send it from EAT time zone, just realizing that people in US
> can't understand how did I send the e-mail ahead of time. My
> mistake. It is better that I represent it in their time, then they
> will know it was night in their city when I was sending it.
>
> Time shall be displayed correctly to the person in that other time
> zone, preferrably in his time zone, not mine.

Now I understand, I think.

So, we should let the user specify time zone to be used for export.
Then, when sending an email, you can export the heading to text/html and
Org will set the target time zone as requested.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19  6:25                                             ` Thomas S. Dye
@ 2023-01-19 14:17                                               ` Jean Louis
  2023-01-19 15:55                                                 ` Thomas S. Dye
  0 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-19 14:17 UTC (permalink / raw)
  To: Thomas S. Dye
  Cc: Tim Cross, Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

* Thomas S. Dye <tsd@tsdye.online> [2023-01-19 09:37]:
> Meetings are occurrences, which require absolute time, which has no
> timezones.  Org should record occurrences with timestamps in UTC,
> possibly translating from the user's local time.

User in Grece needs appointment at 9 o'clock, and writes it as:
<2023-01-20 Fri 09:00> He also has TIMEZONE (either system or Org file
based) set to "EET". That way the time has been recorded in UTC for
Org purposes, and UTC has been solved. For Greek user it is completely
solved. Org calculates UTC based on configured time zone. But when it
is 16:00 o'clock in Greece, it is 06:00 in Seattle.

Online appointment is sent to user in Seattle, with the time zone
PST. He receives the Org file from Greece, at 8:00 o'clock, which has
settings inside TIMEZONE="EET". At first user thinks that appointment
is in just 1 hour, because he can see "08:00", but Org gracefully
notifies user that appointment is (probably) in a different time zone,
and asks user if user would like to have it displayed in PST time
zone. User answers with "Yes" and on his screen appears that meeting
is actually at <2023-01-20 Fri 23:00>, he prepares himself for longer
evening, and waits for his Greek partner on Jitsi Meet:
https://meet.jit.si/ to get online.

It confirms your hypothesis, yes, all times are calculated as UTC, but
all time stamps at export, sharing, or change of time zone, shall be
displayable in understandable manner to human user.

> > Org in this state can't handle such things.
> 
> Org can do the useful thing: translate the UTC timestamp into local time and
> report both UTC and local time.  User will be able quickly to determine if
> local time is incorrect for some reason, such as DST or travel.

Other way around, it has to translate time stamp into UTC time in the first place. 

Expecting that all user among so many various time zones write their
time stamps in UTC is not reasonable. Org users are advanced, I know,
but majority of note takers with other applications will not even
think of different time zones, it is surprise they get when dealing
internationally. People are not ready for calculating or even viewing
their own time in UTC time zone, unless they are English or Icelandic,
Portuguese, or Africans in parts of the West Africa.

> Storing timestamps in UTC solves the interval problem Ihor
> raised. Intervals always make sense in absolute time.  Moving them
> to event time leads to the insanity Ihor mentioned.

The other way around. Assuming that time stamps are UTC raises
problems for all other people:
https://upload.wikimedia.org/wikipedia/commons/8/88/World_Time_Zones_Map.png

Org now does not support time stamps, right?

So people write timestamps in their own time zone! Is it right?

My time stamp here is <2023-01-19 Thu 17:12> now, what is yours?

Forcing users to write time stamps in UTC would cause havoc.

Thus time stamps already have their time zones, it is just not
recorded in Org file. 

Options can be created so that:

- user always and automatically record time zone in Org file, for
  example from system time zone, so that when first time property is
  invoked that it stays there:

#+TIMEZONE: EET

Or like this

* TODO Appointment on Jitsy Meet with Greek investor
  DEADLINE: <2023-01-20 Fri 09:00>
  :PROPERTIES:
  :TIMEZONE: EET
  :END:

or inside of the time zone.

When such heading is read in Seattle, Washington, Org will tell to
user or ask to translate it to PST time.

In such translations, EET time is first converted to UTC, for reason
of using system libraries, and not complicating Org, and then
converted to PST time zone.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19  7:23                                             ` Tim Cross
@ 2023-01-19 14:32                                               ` Jean Louis
  2023-01-19 20:09                                                 ` Tim Cross
  0 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-19 14:32 UTC (permalink / raw)
  To: Tim Cross; +Cc: Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

* Tim Cross <theophilusx@gmail.com> [2023-01-19 10:48]:
> You completely misunderstood the specific issue being discussed. You
> clearly have not been following this specific point being discussed and
> your long reply just confuses matters rather than helps.
> 
> This issue is in dealing with the meeting time when the local timezone
> changes due to daylight savings time and the fact you have two different
> requirements

I do not use Org for time stamps. I am using PostgreSQL. My time
stamps show correctly (hopefully) as I rely on the design of that
software. I may be very wrong. Though as user I want simple thing, to
record time, and that time has to be displayed in my time zone, and I
want to have functions which will provide for example accounting
statement in the time zone of the recipient in Washington, USA. As
simple as that.

There is no need for Org to deal with daylight savings, as UTC
underlying functions are expected to deal with it. Time zone database,
C library, I cannot know. But any error there shall go to system
maker. Developing such complexity on Org level is not necessary.

For Emacs it makes fun to have various calendars, but for
international time, that has to be handled by system libraries.

> 1. For meeting where all people are in the same timezone, a transition
> in/out of daylight savings changes nothing. The meeting time stays the same
> 
> 2. For meetings wiht people from different time zones, when daylight
> savings transition occurs, the timestamp needs to be changed.  Nothing
> needs to happen for the people in other time zones - it isn't their
> problem and their meeting time is not affected.

Sure, but that is not calculation for higher level like Org, it is for
lower level, like system library. Discussion shall be given to
developers of GNU C library to solve calculations with daylight
savings. If such functions do not exist, then they can be made.

> Ihor['s suggested solution was to just use the TZ of the 'meeting', but
> that is ambiguous. A meeting doesn't have a time zone and picking just
> one of the recipients doens't help as now you just have the issues of
> their daylight savings transitions etc.

☺️ A meeting can have time zone. My friend, that is exactly how we do
meetings, I have even given examples from my life on meeting
scheduling on this mailing list. 

We say "Greek time 9 o'clock AM" -- and we meet and talk to each
other. If there is any daylight saving, so? My computer will think
about it. Not me. I have alarm that counts down, I must rely on my
devices. 

See:

System time and hardware clock
https://www.suse.com/support/kb/doc/?id=000016358

> The Linux kernel maintains a system time. This time is initialized at boot time using the hardware clock(also known as real time clock, RTC, BIOS clock or CMOS clock). As the hardware clock does not provide information as to whether it is kept in UTC or in local time, this needs to be configured explicitly, in YaST -> System -> /etc/sysconfig Editor -> System -> Environment -> Clock -> HWCLOCK.

> Linux changing to and from DST

> Linux will change to and from DST when the HWCLOCK setting is set to `-u', i.e. when the hardware clock is set to UTC (which is closely related to GMT), regardless of whether Linux was running at the time DST is entered or left.

> When the HWCLOCK setting is set to `--localtime', Linux will not
> adjust the time, operating under the assumption that your system may
> be a dual boot system at that time and that the other OS takes care of
> the DST switch. If that was not the case, the DST change needs to be
> made manually.

As you can see it is up to system libraries and user settings how to
provide DST. 

Org need not touch that, only convert from time zone time to UTC, from
UTC to time zone time.

> The 'solution' is to record this meeting in UTC tz. However, to make
> this 'workable' for most people, the interface for managing timestamps
> needs to make this easy.

Then again you have to tell that it is "UTC", which means you are
already specifying some time zone. 

You could tell that Org always thinks of UTC, but that again means UTC
as mark, must be somewhere placed, all users must know that it is UTC,
and again there is need for users to display time in their time zone.

What do you achieve by that design? 

You will get confusion, as you are forcing majority of the world first
to understand what is UTC.

Computers don't do that, they ask you, where are you? Athens, Greece?
Thanks, here is your time.

They don't tell you "let us keep meeting time in UTC" confusing users.

Follow the decade long trend human usability trend and use time zones.

> For example, I would probablyh want an interface where by default,
> my timestamps have no TZ data, but if I call the command to add a
> timestamp with the universal argument, it will add a default tz and
> allow me to easily change it to a different one.

Time stamp does not need to have TZ data, and your function desire is
just fine and correct.

Org file need not have any property of TZ data. 

What needs property is only when:

- Org files is shared or exported so that people in other time zones
  use that

- When single heading as task is shared or some text with embedded
  time stamps

- When user like you change time zone and that change is detected by
  computer (Org)

Which implies that ALL Org exports ever were ambigously created on
export! As in HTML export for example:

Created: 2023-01-19 Thu 17:31 (without time zone) is very ambigous.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19 10:43                   ` Ihor Radchenko
@ 2023-01-19 14:37                     ` Jean Louis
  0 siblings, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-19 14:37 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Tim Cross, Daryl Manning, emacs-orgmode

* Ihor Radchenko <yantar92@posteo.net> [2023-01-19 13:43]:
> So, we should let the user specify time zone to be used for export.
> Then, when sending an email, you can export the heading to text/html and
> Org will set the target time zone as requested.

Exactly.

Follow the iCalendar export option TIMEZONE. Why did author insist on it?

(info "(org) iCalendar Export")

>    The iCalendar export back-end includes ‘SUMMARY’, ‘DESCRIPTION’,
> ‘LOCATION’, ‘TIMEZONE’ and ‘CLASS’ properties from the Org entries when
> exporting.  To force the back-end to inherit the ‘LOCATION’, ‘TIMEZONE’
> and ‘CLASS’ properties, configure the ‘org-use-property-inheritance’
> variable.

When exporting file or not exporting, the recipient may receive the
file and be in different time zone. If file has no time zone property,
then user in different time zone cannot know what time is being talked
about.

That means that function of sending appointments (headings or TODO
tasks) should embed timezone property in such heading. Or the function
that exports Org file shall embed something like #+TIMEZONE: PST in
the Org file, or at least ask user, or allow such exports by
customized functions.

And all stamps like "Created: " in HTML shall get its time zone,
because without it, time remains ambigous, and also in probably 98%
cases wrong. Why display wrong time? If it is for user only, that is
fine, but if HTML is published on web server for others, the time has
significance.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19 14:17                                               ` Jean Louis
@ 2023-01-19 15:55                                                 ` Thomas S. Dye
  2023-01-21 13:10                                                   ` Jean Louis
  2023-01-21 13:50                                                   ` Jean Louis
  0 siblings, 2 replies; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-19 15:55 UTC (permalink / raw)
  To: Jean Louis
  Cc: Thomas S. Dye, Tim Cross, Ihor Radchenko, Daryl Manning, rjhorn,
	emacs-orgmode

Aloha Jean Louis,

Jean Louis <bugs@gnu.support> writes:

> * Thomas S. Dye <tsd@tsdye.online> [2023-01-19 09:37]:
>> Meetings are occurrences, which require absolute time, which 
>> has no
>> timezones.  Org should record occurrences with timestamps in 
>> UTC,
>> possibly translating from the user's local time.
>
> User in Grece needs appointment at 9 o'clock, and writes it as:
> <2023-01-20 Fri 09:00> He also has TIMEZONE (either system or 
> Org file
> based) set to "EET". That way the time has been recorded in UTC 
> for
> Org purposes, and UTC has been solved. For Greek user it is 
> completely
> solved. Org calculates UTC based on configured time zone. But 
> when it
> is 16:00 o'clock in Greece, it is 06:00 in Seattle.
>
> Online appointment is sent to user in Seattle, with the time 
> zone
> PST. He receives the Org file from Greece, at 8:00 o'clock, 
> which has
> settings inside TIMEZONE="EET". At first user thinks that 
> appointment
> is in just 1 hour, because he can see "08:00", but Org 
> gracefully
> notifies user that appointment is (probably) in a different time 
> zone,
> and asks user if user would like to have it displayed in PST 
> time
> zone. User answers with "Yes" and on his screen appears that 
> meeting
> is actually at <2023-01-20 Fri 23:00>, he prepares himself for 
> longer
> evening, and waits for his Greek partner on Jitsi Meet:
> https://meet.jit.si/ to get online.
>
> It confirms your hypothesis, yes, all times are calculated as 
> UTC, but
> all time stamps at export, sharing, or change of time zone, 
> shall be
> displayable in understandable manner to human user.
>
Only occurrences require absolute time, UTC.  Events do not.  They 
follow the user's space/time.

>> > Org in this state can't handle such things.
>> 
>> Org can do the useful thing: translate the UTC timestamp into 
>> local time and
>> report both UTC and local time.  User will be able quickly to 
>> determine if
>> local time is incorrect for some reason, such as DST or travel.
>
> Other way around, it has to translate time stamp into UTC time 
> in the first place. 

Yes, to store the time stamp, Org must take it from the event time 
of the user and translate it to UTC.  When reporting an occurrence 
to the user, then Org must translate from UTC to the user's 
space/time.  User might have a toggle, like pretty entities, that 
either shows UTC or translation to user's space/time.

> Expecting that all user among so many various time zones write 
> their
> time stamps in UTC is not reasonable. Org users are advanced, I 
> know,
> but majority of note takers with other applications will not 
> even
> think of different time zones, it is surprise they get when 
> dealing
> internationally. People are not ready for calculating or even 
> viewing
> their own time in UTC time zone, unless they are English or 
> Icelandic,
> Portuguese, or Africans in parts of the West Africa.
>
Org should translate from the user's space/time to absolute time, 
UTC.  The user has to tell Org what is the space/time relationship 
to absolute time.  Org might use the timezone machinery to suggest 
a space/time relationship to absolute time, and it might warn the 
user when the user's suggested relationship differs from the value 
reported by the timezone machinery.

>> Storing timestamps in UTC solves the interval problem Ihor
>> raised. Intervals always make sense in absolute time.  Moving 
>> them
>> to event time leads to the insanity Ihor mentioned.
>
> The other way around. Assuming that time stamps are UTC raises
> problems for all other people:
> https://upload.wikimedia.org/wikipedia/commons/8/88/World_Time_Zones_Map.png
>
> Org now does not support time stamps, right?
>
> So people write timestamps in their own time zone! Is it right?

IIUC, Org currently stores events, which are relative to the 
user's space/time.  This works for events, but breaks for 
occurrences, which require absolute time, UTC.

>
> My time stamp here is <2023-01-19 Thu 17:12> now, what is yours?

<2023-01-19 Thu 06:08>  This is an event, specified relative to my 
space/time.

>
> Forcing users to write time stamps in UTC would cause havoc.

Agreed, Org should help.

>
> Thus time stamps already have their time zones, it is just not
> recorded in Org file. 

Events don't need a time zone, only occurrences need absolute 
time.

>
> Options can be created so that:
>
> - user always and automatically record time zone in Org file, 
> for
>   example from system time zone, so that when first time 
>   property is
>   invoked that it stays there:
>
> #+TIMEZONE: EET
>
> Or like this
>
> * TODO Appointment on Jitsy Meet with Greek investor
>   DEADLINE: <2023-01-20 Fri 09:00>
>   :PROPERTIES:
>   :TIMEZONE: EET
>   :END:
>
> or inside of the time zone.
>
> When such heading is read in Seattle, Washington, Org will tell 
> to
> user or ask to translate it to PST time.
>
> In such translations, EET time is first converted to UTC, for 
> reason
> of using system libraries, and not complicating Org, and then
> converted to PST time zone.

The Org user in Seattle would either see UTC or toggle to see UTC 
translated to Seattle space/time, assuming user set space/time 
relationship to UTC correctly.  If not, then Org should warn user 
that the specified relationship differs from the one suggested by 
the timezone machinery.

hth,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-17  8:45                           ` Ihor Radchenko
@ 2023-01-19 16:56                             ` Robert Horn
  0 siblings, 0 replies; 330+ messages in thread
From: Robert Horn @ 2023-01-19 16:56 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: rjhorn, Daryl Manning, emacs-orgmode


Ihor Radchenko <yantar92@posteo.net> writes:

> Robert Horn <rjhorn@panix.com> writes:
>
>>> Not really. Countries may change DST at any moment in future. Or decide
>>> to switch calendars (consider countries near the day transition line).
>>>
>>> And "past local time, according to the DST rules in effect at the time"
>>> is also an option that might be useful in certain scenarios.
>>>
>> The issue is clarity of the expected rules for the format.  If I
>> schedule a meeting for 10:05 DST, but the rules change so that it is not
>> DST at that location at that time in the future, what is the expected
>> interpretation?  It could be:
>
> Let me clarify. I do not think that we need to offer selecting DST/no
> DST in the timestamp. Instead, we offer something like
> <2028-12-11 18:00@Europe/Berlin>, specifying local time, including
> possible DST transitions or any other political decisions the country
> might make regarding the local time rules.
>

That would cover it for me.  So, 18:00@Europe/Berlin is the "then local
time", 18:00@CET would be Central European standard time and 18:00@CEST
would be Central European Summer Time.  18:00@UTC would be 19:00@CET and
18:00@CEST. I've found that by far the most common scheduling uses the
"then local time" because that's what people usually want.  I know when
someone schedules a meeting in late March they rarely figure out whether
it will be summer time or standard time.


> Or, if the preference is specifying time in such a way that it is
> unaffected by the local time rules (for example, "+10000 hours from now,
> no matter what the DST/no DST or whatever rules will happen in the
> middle"), one can use explicit UTC offsets like <2028-12-11
> 18:00@UTC+02>

Interesting question.  Some uses (like scheduling physical process) want
+4 hours to mean 4 hours later regardless of leap seconds or summer time
changes.  But most people scheduling issues where they say "in 24 hours"
they actually mean +24 in local time.  At the transition to or from
summer time the phrase "within 24 hours" usually means 24 hours except
on the transition days when it's 23 or 25 hours.

Don't worry about TAI.  People who are working in TAI are unlikely to
expect org to support TAI. 


-- 
Robert Horn
rjhorniii@gmail.com


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 15:43                 ` Daryl Manning
  2023-01-16 19:07                   ` Ihor Radchenko
@ 2023-01-19 17:33                   ` Alexander Adolf
  1 sibling, 0 replies; 330+ messages in thread
From: Alexander Adolf @ 2023-01-19 17:33 UTC (permalink / raw)
  To: Daryl Manning, Ihor Radchenko; +Cc: emacs-orgmode

Daryl Manning <daryl@wakatara.com> writes:

> [...]
> I'd just be excited to have us run through the basic use cases and then see
> some more "tricky" ones. I imagine there are things we'd just have to
> say... too tricky for (eg. flight takes off in one TZ and range allows it
> to land in timezone... stuff like that might be tricky.).
> [...]

This case doesn't seem tricky to me for as long as both time
specifications have time zone information.

For cross-timezone flights, the VCS calendar appointments airlines send
out by email to customers typically have start and end times given in
UTC. The user's calendaring app will convert that to the time zone in
which the OS of the user's laptop currently pretends to be.

Same thing for flights spanning DST changeovers, btw. A UTC
specification is unambiguous in this case, too.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 20:47                         ` Robert Horn
                                             ` (2 preceding siblings ...)
  2023-01-17  8:45                           ` Ihor Radchenko
@ 2023-01-19 17:44                           ` Alexander Adolf
  2023-01-19 17:48                           ` Alexander Adolf
  4 siblings, 0 replies; 330+ messages in thread
From: Alexander Adolf @ 2023-01-19 17:44 UTC (permalink / raw)
  To: Robert Horn, Ihor Radchenko; +Cc: rjhorn, Daryl Manning, emacs-orgmode

Robert Horn <rjhorn@panix.com> writes:

> [...]
> The issue is clarity of the expected rules for the format.  If I
> schedule a meeting for 10:05 DST,
> [...]

In all calendaring software I have used thus far, I don't do that. I can
specify a date and time of day only (but never "DST"). The software then
works out (likely with the help of the OS, and using POSIX APIs) whether
that is DST or not, whenever the event's offset to UTC is needed (e.g.
to display the event in another timezone).


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-16 20:47                         ` Robert Horn
                                             ` (3 preceding siblings ...)
  2023-01-19 17:44                           ` Alexander Adolf
@ 2023-01-19 17:48                           ` Alexander Adolf
  4 siblings, 0 replies; 330+ messages in thread
From: Alexander Adolf @ 2023-01-19 17:48 UTC (permalink / raw)
  To: Robert Horn, Ihor Radchenko; +Cc: rjhorn, Daryl Manning, emacs-orgmode

Robert Horn <rjhorn@panix.com> writes:

> [...]
> Getting the rules and explanation clear is the issue.  It's a mistake
> that a great many people make with scheduling meetings.  Those two
> behaviors need different encodings because they behave differently.
> [...]

AFAIU, setting "clear rules" for this seems impossible. Around DST
changeovers, there are ambiguous time-of-day specifications, which occur
more than once on that date. Hence, for such events UTC time
specifications must be used, or everybody is doomed to either arrive
hours early, or hours late for the appointment.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18 21:16                                         ` Tim Cross
  2023-01-19  5:29                                           ` Jean Louis
  2023-01-19 10:35                                           ` [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Ihor Radchenko
@ 2023-01-19 17:57                                           ` Alexander Adolf
  2023-01-21 13:51                                             ` Jean Louis
  2 siblings, 1 reply; 330+ messages in thread
From: Alexander Adolf @ 2023-01-19 17:57 UTC (permalink / raw)
  To: Tim Cross, Ihor Radchenko; +Cc: Daryl Manning, rjhorn, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> [...]
> Consider this scenario. I have a meeting with two other people. We are
> all in different timezone. What is the timezone of the meeting?
>
> Thinking more about it, in this situation, you probably just need to
> set the meeting time to UTC and that would work.
> [...]

Or to any other timezone. The key point here is that you _do_ specify a
timezone. Then, everybody can convert that and have it displayed in any
timezone they find useful.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19 14:32                                               ` Jean Louis
@ 2023-01-19 20:09                                                 ` Tim Cross
  2023-01-19 23:02                                                   ` Thomas S. Dye
  2023-01-20  4:03                                                   ` Max Nikulin
  0 siblings, 2 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-19 20:09 UTC (permalink / raw)
  To: Jean Louis; +Cc: Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

> * Tim Cross <theophilusx@gmail.com> [2023-01-19 10:48]:
>> You completely misunderstood the specific issue being discussed. You
>> clearly have not been following this specific point being discussed and
>> your long reply just confuses matters rather than helps.
>> 
>> This issue is in dealing with the meeting time when the local timezone
>> changes due to daylight savings time and the fact you have two different
>> requirements
>
> I do not use Org for time stamps. I am using PostgreSQL.

Then your input here is not terribly relevant IMO.


> My time
> stamps show correctly (hopefully) as I rely on the design of that
> software. I may be very wrong. Though as user I want simple thing, to
> record time, and that time has to be displayed in my time zone, and I
> want to have functions which will provide for example accounting
> statement in the time zone of the recipient in Washington, USA. As
> simple as that.
>

Completely irrelevant to the point being discussed. Yet again, you are
just pushing your beliefs and pet peeves without actually comprehending
what is being discussed. 

> There is no need for Org to deal with daylight savings, as UTC
> underlying functions are expected to deal with it. Time zone database,
> C library, I cannot know. But any error there shall go to system
> maker. Developing such complexity on Org level is not necessary.
>

Yet more indication you don't understand the issue. Nobody has suggested
that org does daylight savings calculation - in fact, the one constant
from all the issues raised in this thread is that all the time zone
calculations, conversion between time zones, calculation/conversion to
display format etc is handled by system libraries not org. 


> For Emacs it makes fun to have various calendars, but for
> international time, that has to be handled by system libraries.
>
>> 1. For meeting where all people are in the same timezone, a transition
>> in/out of daylight savings changes nothing. The meeting time stays the same
>> 
>> 2. For meetings wiht people from different time zones, when daylight
>> savings transition occurs, the timestamp needs to be changed.  Nothing
>> needs to happen for the people in other time zones - it isn't their
>> problem and their meeting time is not affected.
>
> Sure, but that is not calculation for higher level like Org, it is for
> lower level, like system library. Discussion shall be given to
> developers of GNU C library to solve calculations with daylight
> savings. If such functions do not exist, then they can be made.
>

You still missed the point. It isn't about the calculation - where that
happens is largely irrelevant and as has been stated numerous times, org
will use the built-in Emacs interface to system facilities for this.

The issue is far more fundamental. Display the agenda with correct
meeting times regardless of daylight savings transitions. As only
meeting with participants from different timezones are affected by such
transitions, we need a way to distinguish those timestamps from
timestamps for meetings with all participants in the same time zone.

>> Ihor['s suggested solution was to just use the TZ of the 'meeting', but
>> that is ambiguous. A meeting doesn't have a time zone and picking just
>> one of the recipients doens't help as now you just have the issues of
>> their daylight savings transitions etc.
>
> ☺️ A meeting can have time zone. My friend, that is exactly how we do
> meetings, I have even given examples from my life on meeting
> scheduling on this mailing list. 
>

Nobody said meetings cannot have time zones. Again, work on your
comprehension. It seems you skim read then jump to the wrong
conclusion.

A meeting does NOT have a time zone. Participants in the meeting have
time zones and it is possible that every participant in the meeting is
in a different time zone. The meeting itself has no time zone.

<snipped a lot of irrelevant stuff>

>
>> The 'solution' is to record this meeting in UTC tz. However, to make
>> this 'workable' for most people, the interface for managing timestamps
>> needs to make this easy.
>
> Then again you have to tell that it is "UTC", which means you are
> already specifying some time zone.

hence the bit where I said 

"However, to make this 'workable' for most people, the interface for
 managing timestamps needs to make this easy."

>
> You could tell that Org always thinks of UTC, but that again means UTC
> as mark, must be somewhere placed, all users must know that it is UTC,
> and again there is need for users to display time in their time zone.
>
> What do you achieve by that design? 
>

It achieves exactly the flexibility needed. As has been made clear many
many times in this thread, what we are talking about is the ability to
add time zone information, not a requirement to do so. If your use case
needs that, then org becomes more useful. If it is of no benefit in your
case, then you don't have to use it.

To reiterate for the last time, there are 2 clear and different use
cases for timestamps associated with meetings.

1. A meeting timestamp for a meeting where all the participants are in
the same time zone. This meeting should remain at the same time
regardless of transitions in/out of daylight savings. The meeting is at
3pm every tuesday all year round.

2. A meeting timestamp for a meeting where all the participants are in
different time zones. When daylight savings transitions occur, the time
of that meeting needs to move forward/back by one hour (depending on
which transition occurs), but only forthe local participant.  Nothing
changes for the other participants and they do not need to know that the
local participants meeting time has changed.

The original question I posed is how would org distinguish between these
two timestamps and know that the second one needs to have the time
changed following a daylight savings transition and the first one does not. 

The answer is to use a timestamp in UTC timesone for the second
meeting. Note that this doesn't mean it is displayed to the user in UTC
time - it would be displayed to the user in their local time.

For org, this means everything would now work. When the user's time zone
transitions in/out of daylight savings time, timestamps with no timezone
data or in the local time zone say the same. TImestamps in UTC will
display an hour earlier/later depending on the transition and the person
will still turn up to the meeting at the correct time. 

> You will get confusion, as you are forcing majority of the world first
> to understand what is UTC.
>

That is an assumption on your part. If you had read and comprehended the
thread, you would have seen that once we identified that using the
different timestamp time zones could address the two use cases, the next
question was about how to implement this to make it easy for the
user.

For example, we could have functions specifically for booking meetings
with participants from different time zones or we could have a different
interface for booking meetings which gets additional details from the
user (such as the list of participants and their time zones) or any
number of other options which make this easy for the user and hides this
detail from them completely.


> Computers don't do that, they ask you, where are you? Athens, Greece?
> Thanks, here is your time.
>
> They don't tell you "let us keep meeting time in UTC" confusing users.
>
> Follow the decade long trend human usability trend and use time zones.
>

UTC is a time zone - just one where offset is +0000

>> For example, I would probablyh want an interface where by default,
>> my timestamps have no TZ data, but if I call the command to add a
>> timestamp with the universal argument, it will add a default tz and
>> allow me to easily change it to a different one.
>
> Time stamp does not need to have TZ data, and your function desire is
> just fine and correct.
>

No, as already explained, without TZ data, there is no way org can
distinguish the two different use cases outlined.

There have been numerous examples where TZ data in timestamps will be
extremely useful. What now needs to be clarified is

- Best interface for managing timestamps with TZ data
- Best way to deal with timestamps with tz data and export backends (for
- example, your workflow where you want exported documents to have the
  timestamps in the local time of your clients)
- Strategy for dealing with timestamps that may have different time
  zones when it comes to calculations such as duration, repeating etc,  

plus other things not yet thought of or discovered. This will be an
on-going refinement process that will expand
functionality/options. Precisely how it will evolve is not 100% clear at
this point. That will be determined by how people use it and future
feature requests.




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19 20:09                                                 ` Tim Cross
@ 2023-01-19 23:02                                                   ` Thomas S. Dye
  2023-01-19 23:51                                                     ` Tim Cross
  2023-01-20  4:03                                                   ` Max Nikulin
  1 sibling, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-19 23:02 UTC (permalink / raw)
  To: Tim Cross
  Cc: Jean Louis, Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

Aloha Tim,

> UTC is a time zone - just one where offset is +0000

UTC is absolute time.  It lacks the spatial component that defines 
a time zone.

hth,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19 23:02                                                   ` Thomas S. Dye
@ 2023-01-19 23:51                                                     ` Tim Cross
  2023-01-20  0:24                                                       ` Thomas S. Dye
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-19 23:51 UTC (permalink / raw)
  To: Thomas S. Dye
  Cc: Jean Louis, Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

"Thomas S. Dye" <tsd@tsdye.online> writes:

> Aloha Tim,
>
>> UTC is a time zone - just one where offset is +0000
>
> UTC is absolute time.  It lacks the spatial component that defines a time zone.
>

Really? I would have thought the prime meridian was the spacial
component for UTC? I thought the full long time zone name was Etc/UTC
and UTC as the abbreviation.

Regardless, in all the libraries I've used, you can use Etc/UTC or UTC
in exactly the same way you would use something like Australia/Sydney or
AEST. So perhaps, from a pedantic standpoint, it is not a time zone, but
for all intent and purpose in this discussion, I feel that point is
irrelevant.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19 23:51                                                     ` Tim Cross
@ 2023-01-20  0:24                                                       ` Thomas S. Dye
  2023-01-20  3:46                                                         ` Tim Cross
  0 siblings, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-20  0:24 UTC (permalink / raw)
  To: Tim Cross
  Cc: Thomas S. Dye, Jean Louis, Ihor Radchenko, Daryl Manning, rjhorn,
	emacs-orgmode

Aloha Tim,

Tim Cross <theophilusx@gmail.com> writes:

> "Thomas S. Dye" <tsd@tsdye.online> writes:
>
>> Aloha Tim,
>>
>>> UTC is a time zone - just one where offset is +0000
>>
>> UTC is absolute time.  It lacks the spatial component that 
>> defines a time zone.
>>
>
> Really? I would have thought the prime meridian was the spacial
> component for UTC? I thought the full long time zone name was 
> Etc/UTC
> and UTC as the abbreviation.
>
> Regardless, in all the libraries I've used, you can use Etc/UTC 
> or UTC
> in exactly the same way you would use something like 
> Australia/Sydney or
> AEST. So perhaps, from a pedantic standpoint, it is not a time 
> zone, but
> for all intent and purpose in this discussion, I feel that point 
> is
> irrelevant.

Agreed.  It does seem irrelevant for time zone libraries.

Nevertheless, from the Org perspective it might not be.  An 
occurrence, which marks changes in the nature or relations of 
things at a time, requires absolute time.  Meetings, which involve 
a change in relation among participants, are occurrences.  IMO, 
this indicates Org should give occurrences a UTC timestamp, then 
translate that for each of the participants using their local time 
zone.  The insane interval problems that Ihor brought up are moot 
in absolute time.  A single timestamp serves a meeting regardless 
of whether the participants are all in one time zone or spread 
around the globe.

An occurrence contrasts with an event, which is tied to the user's 
space/time.  Time here is relative to the user.  IMO, this means 
that Org should give events a timestamp without reference to 
either absolute time or a particular time zone, like the one it 
uses now.

hth,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  0:24                                                       ` Thomas S. Dye
@ 2023-01-20  3:46                                                         ` Tim Cross
  2023-01-20  6:14                                                           ` Thomas S. Dye
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-20  3:46 UTC (permalink / raw)
  To: Thomas S. Dye
  Cc: Jean Louis, Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

"Thomas S. Dye" <tsd@tsdye.online> writes:

> Aloha Tim,
>
> Tim Cross <theophilusx@gmail.com> writes:
>
>> "Thomas S. Dye" <tsd@tsdye.online> writes:
>>
>>> Aloha Tim,
>>>
>>>> UTC is a time zone - just one where offset is +0000
>>>
>>> UTC is absolute time.  It lacks the spatial component that defines a time zone.
>>>
>>
>> Really? I would have thought the prime meridian was the spacial
>> component for UTC? I thought the full long time zone name was Etc/UTC
>> and UTC as the abbreviation.
>>
>> Regardless, in all the libraries I've used, you can use Etc/UTC or UTC
>> in exactly the same way you would use something like Australia/Sydney or
>> AEST. So perhaps, from a pedantic standpoint, it is not a time zone, but
>> for all intent and purpose in this discussion, I feel that point is
>> irrelevant.
>
> Agreed.  It does seem irrelevant for time zone libraries.
>
> Nevertheless, from the Org perspective it might not be.  An occurrence, which marks
> changes in the nature or relations of things at a time, requires absolute time.  Meetings,
> which involve a change in relation among participants, are occurrences.  IMO, this
> indicates Org should give occurrences a UTC timestamp, then translate that for each of the
> participants using their local time zone.  The insane interval problems that Ihor brought
> up are moot in absolute time.  A single timestamp serves a meeting regardless of whether
> the participants are all in one time zone or spread around the globe.
>
> An occurrence contrasts with an event, which is tied to the user's space/time.  Time here
> is relative to the user.  IMO, this means that Org should give events a timestamp without
> reference to either absolute time or a particular time zone, like the one it uses now.
>

Just checking if I understand. I think we are coming from the same
position and with the same conclusion.

In the situation where the meeting involves people from different time
zones, the time of the meeting as reported by org needs to be adjusted
after a daylight savings transition so that the time maintains the same
relative to UTC. i.e. meeting time reported in local time goes
forward/backward 1 hour depending on the daylight savings transition
(in/out). I guess this is what you call an occurrence? 

When all participants in a meeting are in the same time zone, you do not
want the time changed as the result of the daylight savings transition.
This is what you call an event?

So, using your terminology, what we now need is convenience functions
for setting an occurrence timestamp and an event timestamp. I'm not sure
if occurrence/event are the best terms, but I cannot think of better
ones. Just slightly concerned people will have trouble grasping the
difference and undersanding why some meetings are an occurrence while
others are an event. FOr the user, they are just meetings.    


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19 20:09                                                 ` Tim Cross
  2023-01-19 23:02                                                   ` Thomas S. Dye
@ 2023-01-20  4:03                                                   ` Max Nikulin
  2023-01-20  5:39                                                     ` Tim Cross
  2023-01-20  6:46                                                     ` Thomas S. Dye
  1 sibling, 2 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-20  4:03 UTC (permalink / raw)
  To: emacs-orgmode

On 20/01/2023 03:09, Tim Cross wrote:
> To reiterate for the last time, there are 2 clear and different use
> cases for timestamps associated with meetings.
> 
> 1. A meeting timestamp for a meeting where all the participants are in
> the same time zone.
...> 2. A meeting timestamp for a meeting where all the participants are in
> different time zones....

Tim, every scheduled meeting event is associated with some particular 
time zone, often implicitly. So it is single use case.

It is up to participants to negotiate which timezone is the primary one 
for each event. It is matter of people communication, not technical issue.

First Monday 15:00 is (almost) equally precise for
- Australia/Canberra having DST
- Australia/Darwin where currently no DST
- +1000 (the highest chance of improper use unfortunately)
- UTC

Aside from time transition intervals, it is possible to take any of this 
variant and to present time local for other participant across the globe.

Storage timezone may differ from the current user preference which time 
zone should be used to display timestamp or to export it.

The problem arises when several participants believe that their 
timezones are primary ones and they do not sync their schedules through 
a shared file or a DB entry. An application can not solve this problem, 
but it might try to help to identify it. Some efforts are necessary from 
user side. Timestamp should contain list of timezones of other 
participants and cached local time. In such case an application may warn 
users that local time values become inconsistent due to DST transitions 
or due to update of time zone database. Unsure to what degree it should 
be implemented in Org.

So
- It is participants fault if a meeting is not associated with 
particular timezone
- Having a fair time handling library, it does not matter what time zone 
is used to schedule the meeting.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  4:03                                                   ` Max Nikulin
@ 2023-01-20  5:39                                                     ` Tim Cross
  2023-01-20  7:28                                                       ` Max Nikulin
                                                                         ` (2 more replies)
  2023-01-20  6:46                                                     ` Thomas S. Dye
  1 sibling, 3 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-20  5:39 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 20/01/2023 03:09, Tim Cross wrote:
>> To reiterate for the last time, there are 2 clear and different use
>> cases for timestamps associated with meetings.
>> 1. A meeting timestamp for a meeting where all the participants are in
>> the same time zone.
> ...> 2. A meeting timestamp for a meeting where all the participants are in
>> different time zones....
>
> Tim, every scheduled meeting event is associated with some particular time zone, often
> implicitly. So it is single use case.
>

No, I disagree with that statement. That is old thinking based when
meetings meant face to face meetings. Only meeting which have a specific
location can have a time zone and even then, it isn't really the
meetings time zone, but instead the time zone of the participants at the
meeting.

Meetings without a specific location do not have time zones, implicit or
otherwise. If you have an on-line meeting with 5 people from 5 different
time zones, there is no time zone which takes precedence and cna be
thought of as the meeting time zone. You could decide to do that if you
wanted, but it doesn't achieve anything useful. 

> It is up to participants to negotiate which timezone is the primary one for each event. It
> is matter of people communication, not technical issue.
>

The issue I'm talking about has nothing to do with the other
participants of the meeting. It is irrelevant to them when my time zone
changes due to daylight savings.

> First Monday 15:00 is (almost) equally precise for
> - Australia/Canberra having DST
> - Australia/Darwin where currently no DST
> - +1000 (the highest chance of improper use unfortunately)
> - UTC
>

That is a bad example and is wrong. Australia/Canberra and
Australia/Darwin are different timezones regardless. Darwin is +930 and
Canberra is +1000 (+1100 with DS). So Monday 15;00 in Darwin will be at
15:30 in Canberra outside DS time and 16:30 during DS time.

> Aside from time transition intervals, it is possible to take any of this variant and to
> present time local for other participant across the globe.
>
> Storage timezone may differ from the current user preference which time zone should be
> used to display timestamp or to export it.
>
> The problem arises when several participants believe that their timezones are primary ones
> and they do not sync their schedules through a shared file or a DB entry. An application
> can not solve this problem, but it might try to help to identify it. Some efforts are
> necessary from user side. Timestamp should contain list of timezones of other participants
> and cached local time. In such case an application may warn users that local time values
> become inconsistent due to DST transitions or due to update of time zone database. Unsure
> to what degree it should be implemented in Org.
>

and this is not the issue I'm trying to solve here. At no time did I
reference booking meetings or scheduling meetings with others. This has
nothing to do with eh use case I was outlining. 

> So
> - It is participants fault if a meeting is not associated with particular timezone
> - Having a fair time handling library, it does not matter what time zone is used to
>  schedule the meeting.

OK, I just give up.

I don't understand why my very simple point seems so hard for anyone to
grasp and why everyone seems so focused on the booking and scheduling of
meetings with outhers. This was never in the scope of the very simple
issue I want solved. 

All I want is for org to tell me when my meeting is. I don't care about
other people's time zones or when the meeting is for them, I don't care
who books the meeting and I don't care whether someone feels the meeting
has a time zone or not because it is all totally irrelevant for my use
case.

This is very very simple and doesn't need to be over thought.

I have two reoccurring meetings.

Meeting 1. All of the people for this meeting are in my time zone. When
daylight savings transitions occur, there is no impact. THis is how org
timestamps work now. Nothing is required.

Meeting 2. This meeting has 5 participants. They are all in different
time zones. When daylight savings time transitions occur in my timezone,
I need the time stamp to report an adjusted time based on the change
(either forward or back 1 hour). Currently, org cannot manage this and
my meeting time is out by one hour for 6 months of the year. 

How is this handled by org?

My suggested solution, which I feel is quite simple is to simply use a
timestamp with a UTC or Etc/UTC value for the time zone for meetings
with participants from different time zones and where the time of the
meeting must remain constant with respect to UTC. Assuming that once org
timestamps handling has been updated to display timestamps according to
the local time zone, the issue with the second meeting example is
solved. Thats it, done.

You might sayh this isn't a technical issue, but it can obviously be
solved adopting a technical solution.

All that remains is to work out a good interface to make it easy to set
the correct timestamp type (i.e. in local time or UTC) based on the
requirements for that meeting (which is determined by whether the
meeting has any participants in different time zones). How sophisticated
we want ot make this is undecided. My simple sugestion wa that have the
commands which insert timestamps use the universal argument - when
called with the universal argument, set the timestamp using UTC and when
it isn't, set it as it is now (or set it with the local TZ added, based
on user preference).


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  3:46                                                         ` Tim Cross
@ 2023-01-20  6:14                                                           ` Thomas S. Dye
  2023-01-27  6:06                                                             ` Sterling Hooten
  0 siblings, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-20  6:14 UTC (permalink / raw)
  To: Tim Cross
  Cc: Thomas S. Dye, Jean Louis, Ihor Radchenko, Daryl Manning, rjhorn,
	emacs-orgmode

Aloha Tim,

Tim Cross <theophilusx@gmail.com> writes:

> "Thomas S. Dye" <tsd@tsdye.online> writes:
>
>> Aloha Tim,
>>
>> Tim Cross <theophilusx@gmail.com> writes:
>>
>>> "Thomas S. Dye" <tsd@tsdye.online> writes:
>>>
>>>> Aloha Tim,
>>>>
>>>>> UTC is a time zone - just one where offset is +0000
>>>>
>>>> UTC is absolute time.  It lacks the spatial component that 
>>>> defines a time zone.
>>>>
>>>
>>> Really? I would have thought the prime meridian was the 
>>> spacial
>>> component for UTC? I thought the full long time zone name was 
>>> Etc/UTC
>>> and UTC as the abbreviation.
>>>
>>> Regardless, in all the libraries I've used, you can use 
>>> Etc/UTC or UTC
>>> in exactly the same way you would use something like 
>>> Australia/Sydney or
>>> AEST. So perhaps, from a pedantic standpoint, it is not a time 
>>> zone, but
>>> for all intent and purpose in this discussion, I feel that 
>>> point is
>>> irrelevant.
>>
>> Agreed.  It does seem irrelevant for time zone libraries.
>>
>> Nevertheless, from the Org perspective it might not be.  An 
>> occurrence, which marks
>> changes in the nature or relations of things at a time, 
>> requires absolute time.  Meetings,
>> which involve a change in relation among participants, are 
>> occurrences.  IMO, this
>> indicates Org should give occurrences a UTC timestamp, then 
>> translate that for each of the
>> participants using their local time zone.  The insane interval 
>> problems that Ihor brought
>> up are moot in absolute time.  A single timestamp serves a 
>> meeting regardless of whether
>> the participants are all in one time zone or spread around the 
>> globe.
>>
>> An occurrence contrasts with an event, which is tied to the 
>> user's space/time.  Time here
>> is relative to the user.  IMO, this means that Org should give 
>> events a timestamp without
>> reference to either absolute time or a particular time zone, 
>> like the one it uses now.
>>
>
> Just checking if I understand. I think we are coming from the 
> same
> position and with the same conclusion.
>
Thanks!

> In the situation where the meeting involves people from 
> different time
> zones, the time of the meeting as reported by org needs to be 
> adjusted
> after a daylight savings transition so that the time maintains 
> the same
> relative to UTC. i.e. meeting time reported in local time goes
> forward/backward 1 hour depending on the daylight savings 
> transition
> (in/out). I guess this is what you call an occurrence? 
>
> When all participants in a meeting are in the same time zone, 
> you do not
> want the time changed as the result of the daylight savings 
> transition.
> This is what you call an event?

Every meeting is an occurrence because it involves changes in 
relations of things at time; in this case meeting participants 
relate to one another via Jitsi, regardless of whether they are 
all in one time zone or spread over the globe.

An event's time is relative to the user's location, or space/time. 
So, the example I gave earlier "Brush teeth before bed" set to 
10:00 PM, which works whether I am home in Honolulu or enjoying 
the hustle and bustle of Manhattan, is a simple event.  It happens 
at that time in the timezone I happen to inhabit at the moment, 
because I intend to go to sleep shortly after 10:00 PM regardless 
of where I am.

>
> So, using your terminology, what we now need is convenience 
> functions
> for setting an occurrence timestamp and an event timestamp. I'm 
> not sure
> if occurrence/event are the best terms, but I cannot think of 
> better
> ones. Just slightly concerned people will have trouble grasping 
> the
> difference and undersanding why some meetings are an occurrence 
> while
> others are an event. FOr the user, they are just meetings.    

Yes, both meetings are occurrences.

I agree that the terms take some getting used to.  I got them from 
Frank Ramsey, who seemed to be happy with event, but not so happy 
with occurrence.

The difference is this: Will the happening being scheduled involve 
other people, who will share the Org timestamp, or will it take 
place at the same absolute time, regardless of where you are when 
it happens?  If so, then the timestamp should be stored as UTC (it 
is an occurrence that requires absolute time).

Or, is it something you want to do at a time, regardless of where 
you are.  If so, then the usual Org timestamp without UTC is what 
should be stored (it is an event that requires time local to the 
user).

In the case of a meeting, where the one who calls the meeting 
sends an Org file with a meeting agenda and a UTC timestamp to 
each of the participants, Org will translate the UTC timestamp 
into local time for each participant.  Similarly, when you are 
traveling, Org will translate the UTC timestamp to the timezone 
you happen to inhabit.  Here, I'm assuming that the timezone 
machinery is capable of determining local time relative to UTC.

hth,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  4:03                                                   ` Max Nikulin
  2023-01-20  5:39                                                     ` Tim Cross
@ 2023-01-20  6:46                                                     ` Thomas S. Dye
  2023-01-20  7:34                                                       ` Max Nikulin
  2023-01-20  8:17                                                       ` Tim Cross
  1 sibling, 2 replies; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-20  6:46 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Aloha Max,

Max Nikulin <manikulin@gmail.com> writes:

> On 20/01/2023 03:09, Tim Cross wrote:
>> To reiterate for the last time, there are 2 clear and different 
>> use
>> cases for timestamps associated with meetings.
>> 1. A meeting timestamp for a meeting where all the participants 
>> are in
>> the same time zone.
> ...> 2. A meeting timestamp for a meeting where all the 
> participants are in
>> different time zones....
>
> Tim, every scheduled meeting event is associated with some 
> particular time zone,
> often implicitly. So it is single use case.
>
> It is up to participants to negotiate which timezone is the 
> primary one for each
> event. It is matter of people communication, not technical 
> issue.
>
> First Monday 15:00 is (almost) equally precise for
> - Australia/Canberra having DST
> - Australia/Darwin where currently no DST
> - +1000 (the highest chance of improper use unfortunately)
> - UTC
>
> Aside from time transition intervals, it is possible to take any 
> of this variant
> and to present time local for other participant across the 
> globe.
>
> Storage timezone may differ from the current user preference 
> which time zone
> should be used to display timestamp or to export it.
>
> The problem arises when several participants believe that their 
> timezones are
> primary ones and they do not sync their schedules through a 
> shared file or a DB
> entry. An application can not solve this problem, but it might 
> try to help to
> identify it. Some efforts are necessary from user side. 
> Timestamp should contain
> list of timezones of other participants and cached local time. 
> In such case an
> application may warn users that local time values become 
> inconsistent due to DST
> transitions or due to update of time zone database. Unsure to 
> what degree it
> should be implemented in Org.
>
> So
> - It is participants fault if a meeting is not associated with 
> particular
>  timezone
> - Having a fair time handling library, it does not matter what 
> time zone is used
>  to schedule the meeting.

Or, one can recognize that the meeting is an occurrence that 
requires absolute time and a timestamp with UTC.  Each participant 
will resolve UTC to the local time where they happen to be when 
the meeting takes place.  The user might toggle between UTC and 
the local time translation using overlays, like pretty entities. 
This avoids the problem of negotiating a timezone caused by 
forcing an occurrence to be represented as an event relative to a 
fictitious space/time.

hth,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  5:39                                                     ` Tim Cross
@ 2023-01-20  7:28                                                       ` Max Nikulin
  2023-01-20  8:11                                                         ` Tim Cross
  2023-01-20  9:35                                                       ` Fraga, Eric
  2023-01-20 10:48                                                       ` Ihor Radchenko
  2 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-20  7:28 UTC (permalink / raw)
  To: emacs-orgmode

On 20/01/2023 12:39, Tim Cross wrote:
> 
> No, I disagree with that statement. That is old thinking based when
> meetings meant face to face meetings. Only meeting which have a specific
> location can have a time zone and even then, it isn't really the
> meetings time zone, but instead the time zone of the participants at the
> meeting.

Tim, I am trying to say that any meeting either face to face or on-line 
may be associated with arbitrary primary timezone. Even when all 
participants are in Sydney they may decide to fix time in Darwin. It is 
strange, but it is possible. UTC is just one of time zones that may be 
convenient for on-line meeting despite no participant really use it. 
Local timezone is usually preferred for purely face to face meetings. 
You are not realizing that is decision since it is not verbalized. 
Consider timezone as something unrelated to location but just a set of 
rules how time offset in respect to epoch evolves in time.

UI might offer you to choose time in your timezone and to select another 
timezone for storage. For your convenience it still may be presented to 
you in your local timezone even it is stored in UTC or some other one.




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  6:46                                                     ` Thomas S. Dye
@ 2023-01-20  7:34                                                       ` Max Nikulin
  2023-01-20  8:17                                                       ` Tim Cross
  1 sibling, 0 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-20  7:34 UTC (permalink / raw)
  To: emacs-orgmode

On 20/01/2023 13:46, Thomas S. Dye wrote:
> 
> Or, one can recognize that the meeting is an occurrence that requires 
> absolute time and a timestamp with UTC.

Thomas, events and occurrences is something different. The real issue 
that you cannot predict future, so, strictly speaking, you do not know 
what offset from UTC you timezone will have several months later. That 
is why fixing UTC timestamp may cause issues:

http://www.creativedeletion.com/2015/03/19/persisting_future_datetimes.html
Lau Taarnskov. How to save datetimes for future events - (when UTC is 
not the right answer)




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  7:28                                                       ` Max Nikulin
@ 2023-01-20  8:11                                                         ` Tim Cross
  2023-01-20 15:29                                                           ` Max Nikulin
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-20  8:11 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 20/01/2023 12:39, Tim Cross wrote:
>> No, I disagree with that statement. That is old thinking based when
>> meetings meant face to face meetings. Only meeting which have a specific
>> location can have a time zone and even then, it isn't really the
>> meetings time zone, but instead the time zone of the participants at the
>> meeting.
>
> Tim, I am trying to say that any meeting either face to face or on-line may be associated
> with arbitrary primary timezone. Even when all participants are in Sydney they may decide
> to fix time in Darwin. It is strange, but it is possible. UTC is just one of time zones
> that may be convenient for on-line meeting despite no participant really use it. Local
> timezone is usually preferred for purely face to face meetings. You are not realizing that
> is decision since it is not verbalized. Consider timezone as something unrelated to
> location but just a set of rules how time offset in respect to epoch evolves in time.
>

and what you are saying is helpful how? In what way does what you are
sayhing help address my use case?




> UI might offer you to choose time in your timezone and to select another timezone for
> storage. For your convenience it still may be presented to you in your local timezone even
> it is stored in UTC or some other one.

and I have said as much. So, how exactly is your contribution assisting
with the use case I've outlined?



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  6:46                                                     ` Thomas S. Dye
  2023-01-20  7:34                                                       ` Max Nikulin
@ 2023-01-20  8:17                                                       ` Tim Cross
  2023-01-20 12:17                                                         ` Max Nikulin
  1 sibling, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-20  8:17 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Max Nikulin, emacs-orgmode

"Thomas S. Dye" <tsd@tsdye.online> writes:

> Aloha Max,
>
> Max Nikulin <manikulin@gmail.com> writes:
>
>> On 20/01/2023 03:09, Tim Cross wrote:
>>> To reiterate for the last time, there are 2 clear and different use
>>> cases for timestamps associated with meetings.
>>> 1. A meeting timestamp for a meeting where all the participants are in
>>> the same time zone.
>> ...> 2. A meeting timestamp for a meeting where all the participants are in
>>> different time zones....
>>
>> Tim, every scheduled meeting event is associated with some particular time zone,
>> often implicitly. So it is single use case.
>>
>> It is up to participants to negotiate which timezone is the primary one for each
>> event. It is matter of people communication, not technical issue.
>>
>> First Monday 15:00 is (almost) equally precise for
>> - Australia/Canberra having DST
>> - Australia/Darwin where currently no DST
>> - +1000 (the highest chance of improper use unfortunately)
>> - UTC
>>
>> Aside from time transition intervals, it is possible to take any of this variant
>> and to present time local for other participant across the globe.
>>
>> Storage timezone may differ from the current user preference which time zone
>> should be used to display timestamp or to export it.
>>
>> The problem arises when several participants believe that their timezones are
>> primary ones and they do not sync their schedules through a shared file or a DB
>> entry. An application can not solve this problem, but it might try to help to
>> identify it. Some efforts are necessary from user side. Timestamp should contain
>> list of timezones of other participants and cached local time. In such case an
>> application may warn users that local time values become inconsistent due to DST
>> transitions or due to update of time zone database. Unsure to what degree it
>> should be implemented in Org.
>>
>> So
>> - It is participants fault if a meeting is not associated with particular
>>  timezone
>> - Having a fair time handling library, it does not matter what time zone is used
>>  to schedule the meeting.
>
> Or, one can recognize that the meeting is an occurrence that requires absolute time and a
> timestamp with UTC.  Each participant will resolve UTC to the local time where they happen
> to be when the meeting takes place.  The user might toggle between UTC and the local time
> translation using overlays, like pretty entities. This avoids the problem of negotiating a
> timezone caused by forcing an occurrence to be represented as an event relative to a
> fictitious space/time.
>

Exactly.

I am really confused by the constant reference to negotiating between
participants or finding a shared/agreed time zone etc. That is all
totally irrelevant in this use case as outlined. If we were talking
about booking meetings or communicating information about booked
meetings between participants or a different bit of software which
manages sceduling of meetings like one of those many web meeting booking
systems, then that would be a different matter. However, that isn't what
we are talking about. We are talking about org mode. All I am talking
about here is being able to identify two different types of meetings -
ones which need to have times adjusted as a result of daylight savings
time transitions and ones which don't and what mechanism org could use
to distinguish the two. It is that simple. Your occurrence v event
terminology provides two different names which may help label the two
different use cases.

So far, nobody has shown any reason why using UTC to distinguish the
case where the times need to be adjusted and local tz when they don't
won't work a a  mechanism that can be used to allow org to handle things
better than it does now. 





^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  5:39                                                     ` Tim Cross
  2023-01-20  7:28                                                       ` Max Nikulin
@ 2023-01-20  9:35                                                       ` Fraga, Eric
  2023-01-20 10:48                                                       ` Ihor Radchenko
  2 siblings, 0 replies; 330+ messages in thread
From: Fraga, Eric @ 2023-01-20  9:35 UTC (permalink / raw)
  To: Tim Cross; +Cc: Max Nikulin, emacs-orgmode@gnu.org

On Friday, 20 Jan 2023 at 16:39, Tim Cross wrote:
> My simple sugestion wa that have the commands which insert timestamps
> use the universal argument -when called with the universal argument,
> set the timestamp using UTC and when it isn't, set it as it is now (or
> set it with the local TZ added, based on user preference).

+1

I travel a lot; I have meetings arranged with others (online) where I
don't know where I will be.  I simply want to be able to have meeting
times set as UTC and let org tell me when it is depending on which time
zone I am in (as I always update the timezone on my laptop when I change
timezones).

Getting caught up with what happens at the transition to daylight
savings etc. is just a distraction, in my view.  Being able to specify
UTC timestamps and have them displayed in local time will be an
incredible step forward for time related management in org.  Does it
solve everything?  No.  But the current situation is a mess for timezone
related issues and this enhancement would be very welcome.

Thank you,
eric
-- 
: Eric S Fraga, with org release_9.6-201-gb58fba in Emacs 30.0.50

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  5:39                                                     ` Tim Cross
  2023-01-20  7:28                                                       ` Max Nikulin
  2023-01-20  9:35                                                       ` Fraga, Eric
@ 2023-01-20 10:48                                                       ` Ihor Radchenko
  2 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-20 10:48 UTC (permalink / raw)
  To: Tim Cross; +Cc: Max Nikulin, emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> OK, I just give up.
>
> I don't understand why my very simple point seems so hard for anyone to
> grasp and why everyone seems so focused on the booking and scheduling of
> meetings with outhers. This was never in the scope of the very simple
> issue I want solved. 

FYI, I feel like you two and some other people in the thread are talking
about the same thing and simply misunderstand the terms used in
each-other's explanations.

> All that remains is to work out a good interface to make it easy to set
> the correct timestamp type (i.e. in local time or UTC) based on the
> requirements for that meeting (which is determined by whether the
> meeting has any participants in different time zones). How sophisticated
> we want ot make this is undecided. My simple sugestion wa that have the
> commands which insert timestamps use the universal argument - when
> called with the universal argument, set the timestamp using UTC and when
> it isn't, set it as it is now (or set it with the local TZ added, based
> on user preference).

Universal argument is already taken to insert time in addition to date.

I instead suggest allowing `org-read-date' provide completion interface
for TZ once user presses @ (for example) in the date prompt.
When the user press Z (for example), @UTC is inserted and the user can
simply add +XX or -XX as needed to complete the UTC offset.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-14 11:42       ` Ihor Radchenko
  2023-01-15  5:11         ` Max Nikulin
@ 2023-01-20 10:57         ` Ihor Radchenko
  2023-01-20 11:29           ` Daryl Manning
  1 sibling, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-20 10:57 UTC (permalink / raw)
  To: Daryl Manning; +Cc: Tim Cross, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> <2023-01-14 Sat 18:22@Asia/Singapore>  (SGD and similar abbreviations are often ambiguous)
> <2023-01-14 Sat 18:22+0800>
> <2023-01-14 Sat 18:22+08>
> <2023-01-14 Sat 18:22@+0800>
> <2023-01-14 Sat 18:22@+08>

One thing we all missed in the discussion is diary sexps.

In particular, "last Sunday of month" <%%(diary-float t 0)> may depend
on the time zone because the number of days in month may vary.

How can we approach this? What could the format to specify the time zone
for diary timestamps?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 10:57         ` Ihor Radchenko
@ 2023-01-20 11:29           ` Daryl Manning
  2023-01-20 11:36             ` Ihor Radchenko
                               ` (2 more replies)
  0 siblings, 3 replies; 330+ messages in thread
From: Daryl Manning @ 2023-01-20 11:29 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]

Perhaps a leading question (leading to outrage =p ), but does anybody even
use those anymore?

I don't believe I've used them at all in 5 years of using org-mode (and if
I did it was most likely because of some arcane older feature which
required them).

Daryl.

On Fri, Jan 20, 2023 at 5:57 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
> > <2023-01-14 Sat 18:22@Asia/Singapore>  (SGD and similar abbreviations
> are often ambiguous)
> > <2023-01-14 Sat 18:22+0800>
> > <2023-01-14 Sat 18:22+08>
> > <2023-01-14 Sat 18:22@+0800>
> > <2023-01-14 Sat 18:22@+08>
>
> One thing we all missed in the discussion is diary sexps.
>
> In particular, "last Sunday of month" <%%(diary-float t 0)> may depend
> on the time zone because the number of days in month may vary.
>
> How can we approach this? What could the format to specify the time zone
> for diary timestamps?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 1949 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 11:29           ` Daryl Manning
@ 2023-01-20 11:36             ` Ihor Radchenko
  2023-01-20 15:10               ` Daryl Manning
  2023-01-20 11:39             ` Fraga, Eric
  2023-01-20 22:51             ` Tim Cross
  2 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-20 11:36 UTC (permalink / raw)
  To: Daryl Manning; +Cc: emacs-orgmode

Daryl Manning <daryl@wakatara.com> writes:

> Perhaps a leading question (leading to outrage =p ), but does anybody even
> use those anymore?
>
> I don't believe I've used them at all in 5 years of using org-mode (and if
> I did it was most likely because of some arcane older feature which
> required them).

diary exps is the only available way to limit the number of repetitions
of an even.

Also, see org-class, which will automatically skips holidays (let's just
ignore the issue with time zones and holidays, please; just accept the
limitation)

Some real word examples of diary sexps scheduling in the wild:
- https://emacs-apac.gitlab.io/ :: <%%(diary-float t 6 4)>
- https://emacs-berlin.org/ :: <%%(diary-float t 3 -1)>

Finally, religious holidays can be defined and Nth weekday before/after
month/date.

Some people even use diary sexps exclusively.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 11:29           ` Daryl Manning
  2023-01-20 11:36             ` Ihor Radchenko
@ 2023-01-20 11:39             ` Fraga, Eric
  2023-01-20 11:48               ` Ihor Radchenko
  2023-01-21  9:21               ` Ihor Radchenko
  2023-01-20 22:51             ` Tim Cross
  2 siblings, 2 replies; 330+ messages in thread
From: Fraga, Eric @ 2023-01-20 11:39 UTC (permalink / raw)
  To: Daryl Manning; +Cc: Ihor Radchenko, emacs-orgmode@gnu.org

On Friday, 20 Jan 2023 at 18:29, Daryl Manning wrote:
> Perhaps a leading question (leading to outrage =p ), but does anybody
> even use those anymore?

Yes.  I use them for repeating events, in particular those which have
repeating rules like "the first Monday of every month" that org does not
support.

However, having said this, I don't think it's org's responsibility to
address the Emacs Diary: that would be a feature request for Emacs more
generally...

-- 
: Eric S Fraga, with org release_9.6-201-gb58fba in Emacs 30.0.50

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 11:39             ` Fraga, Eric
@ 2023-01-20 11:48               ` Ihor Radchenko
  2023-01-21 12:55                 ` Jean Louis
  2023-01-21  9:21               ` Ihor Radchenko
  1 sibling, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-20 11:48 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Daryl Manning, emacs-orgmode@gnu.org

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> However, having said this, I don't think it's org's responsibility to
> address the Emacs Diary: that would be a feature request for Emacs more
> generally...

Well. Diary sexps do not support time. So, we may already need to add
time info to diary sexps (at least, it is partially supported
by agenda). But if we add time support, the time stamp question also
arises.

Of course, more generally, there is also a question of things like
calendar displaying time in different time zone (for example, when
choosing timestamp date and time in `org-read-date').

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  8:17                                                       ` Tim Cross
@ 2023-01-20 12:17                                                         ` Max Nikulin
  2023-01-20 16:09                                                           ` Thomas S. Dye
  2023-01-20 23:38                                                           ` Tim Cross
  0 siblings, 2 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-20 12:17 UTC (permalink / raw)
  To: emacs-orgmode

On 20/01/2023 15:17, Tim Cross wrote:
> So far, nobody has shown any reason why using UTC to distinguish the
> case where the times need to be adjusted and local tz when they don't
> won't work a a  mechanism that can be used to allow org to handle things
> better than it does now.

Let's try to move in small steps. UTC as storage format.

An issue with events scheduled as local time in some particular timezone 
(not your current one) and stored as UTC timestamp when IANA tzdata is 
updated to use new timezone offset:

https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bullet/
Storing UTC is not a silver bullet

Do you think it should be ignored? I faced such issue.




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-15 13:52                       ` Ihor Radchenko
@ 2023-01-20 14:34                         ` Alexander Adolf
  0 siblings, 0 replies; 330+ messages in thread
From: Alexander Adolf @ 2023-01-20 14:34 UTC (permalink / raw)
  To: Ihor Radchenko, Tim Cross; +Cc: tomas, emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> [...]
> I don't imply that. What I am saying is that we first need to decide on
> syntax and provide basic support for time zones. It will already be
> helpful as I won't need to convert timestamps into local time or think
> if I need to convert timestamps ahead of time before a flight to
> different time zone.
>
> More things can be implemented once we have the basic support.
> [...]
>
> Converting timestamps with time zone to local time is indeed one of the
> basic features we need to support.
> [...]

I fully concur with Ihor.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 11:36             ` Ihor Radchenko
@ 2023-01-20 15:10               ` Daryl Manning
  0 siblings, 0 replies; 330+ messages in thread
From: Daryl Manning @ 2023-01-20 15:10 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]

I just usually put those in the cal manually, with a date if they have
"unusual" recurrences that can;t be denoted by the standard datestamp
recurrences . =]

Though for religious holidays like Easter and, I imagine, some lunar based
ones, I imagine it might be handy. But honestly, I am surprised people use
them anymore. I certainly have managed to avoid them up to now. They feel
slightly anachronistic (much like putting in dates without timezones... =]
).

D.

On Fri, Jan 20, 2023 at 6:36 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> Daryl Manning <daryl@wakatara.com> writes:
>
> > Perhaps a leading question (leading to outrage =p ), but does anybody
> even
> > use those anymore?
> >
> > I don't believe I've used them at all in 5 years of using org-mode (and
> if
> > I did it was most likely because of some arcane older feature which
> > required them).
>
> diary exps is the only available way to limit the number of repetitions
> of an even.
>
> Also, see org-class, which will automatically skips holidays (let's just
> ignore the issue with time zones and holidays, please; just accept the
> limitation)
>
> Some real word examples of diary sexps scheduling in the wild:
> - https://emacs-apac.gitlab.io/ :: <%%(diary-float t 6 4)>
> - https://emacs-berlin.org/ :: <%%(diary-float t 3 -1)>
>
> Finally, religious holidays can be defined and Nth weekday before/after
> month/date.
>
> Some people even use diary sexps exclusively.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 2644 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  8:11                                                         ` Tim Cross
@ 2023-01-20 15:29                                                           ` Max Nikulin
  2023-01-20 22:56                                                             ` Tim Cross
  0 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-20 15:29 UTC (permalink / raw)
  To: emacs-orgmode

On 20/01/2023 15:11, Tim Cross wrote:
> Max Nikulin writes:
> 
>> Tim, I am trying to say that any meeting either face to face or on-line may be associated
>> with arbitrary primary timezone.
> 
> and what you are saying is helpful how? In what way does what you are
> sayhing help address my use case?

Tim, are you trying to convince me that for Org it is enough to have 
timestamps either as local time <2023-02-20 15:00> or as UTC something 
like <2023-02-20 05:00Z> and ability to specify arbitrary timezone 
instead of UTC is redundant?

I believe that in the case of support of optional arbitrary timezone in 
Org files there is no point of distinction between you cases when all 
participants meet face to face (<2023-02-20 15:00> or <2023-02-20 
15:00@Australia/Sydney>) or it is online meeting scheduled as 
<2023-02-20 09:00@Etc/UTC>.

>> UI might offer you to choose time in your timezone and to select another timezone for
>> storage. For your convenience it still may be presented to you in your local timezone even
>> it is stored in UTC or some other one.
> 
> and I have said as much. So, how exactly is your contribution assisting
> with the use case I've outlined?

I had a hope to assure you that unifying the cases you are considering 
as distinct should not make user experience worse.

Local event and UTC is meaningful for UI to enter or adjust timestamp 
where such cases should be easier to select than arbitrary timezone. For 
parsing, generating agenda, or export a more abstract model can be used.




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 12:17                                                         ` Max Nikulin
@ 2023-01-20 16:09                                                           ` Thomas S. Dye
  2023-01-20 16:56                                                             ` Max Nikulin
  2023-01-20 23:38                                                           ` Tim Cross
  1 sibling, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-20 16:09 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Aloha Max,

Max Nikulin <manikulin@gmail.com> writes:

> On 20/01/2023 15:17, Tim Cross wrote:
>> So far, nobody has shown any reason why using UTC to 
>> distinguish the
>> case where the times need to be adjusted and local tz when they 
>> don't
>> won't work a a  mechanism that can be used to allow org to 
>> handle things
>> better than it does now.
>
> Let's try to move in small steps. UTC as storage format.
>
> An issue with events scheduled as local time in some particular 
> timezone (not
> your current one) and stored as UTC timestamp when IANA tzdata 
> is updated to use
> new timezone offset:
>
> https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bullet/
> Storing UTC is not a silver bullet
>
> Do you think it should be ignored? I faced such issue.

Good example!  Thanks for the link.

Note that the problem of arbitrary change of a timezone's relation 
to UTC might be handled differently for occurrences and events.

The blog example is 9AM in Amsterdam at a date some years in the 
future.  Because the example includes a place, it refers to 
space/time, and is an event (not an occurrence).  Now, if 
Amsterdam's timezone arbitrarily changes its relation to UTC 
before the conference takes place, then everyone who participates 
in the conference must notice this (or miss the start of the 
conference).

Let's consider an occurrence.  A virtual conference is organized 
by someone in Amsterdam, who sets a start time corresponding to 
9AM in Amsterdam at a date some years in the future and invites 
participants from all over the world.  Now, if Amsterdam's 
timezone arbitrarily changes its relation to UTC before the 
conference takes place, then must everyone notice this?  Or, 
should Org, from the time the arbitrary change is made public, 
simply adjust the conference time for all the participants in the 
Amsterdam timezone?  The latter makes sense to me--all the 
participants in Amsterdam will be aware of the arbitrary change, 
so will not be surprised when Org calculates a different start 
time. Such a change would almost certainly confuse participants 
unaware of the arbitrary change in Amsterdam timezone.

hth,
Tom



--
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-18 16:20                       ` Jean Louis
@ 2023-01-20 16:27                         ` Max Nikulin
  0 siblings, 0 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-20 16:27 UTC (permalink / raw)
  To: emacs-orgmode

On 18/01/2023 23:20, Jean Louis wrote:
> Is there any program, software, system, that is really so good with
> time, apart from PostgreSQL database that I know with 1195 defined
> time zones?
...
>                    name                  | abbrev | utc_offset | is_dst
> ----------------------------------------+--------+------------+--------
>   NZ                                     | NZDT   | 13:00:00   | t
>   GB-Eire                                | GMT    | 00:00:00   | f

What conclusion should we make looking at this long table? I am unsure 
concerning difference from content of tzdata package (IANA or Olson DB) 
that is rather standard on Linux. Emacs uses it though libc (API has 
some limitations, but conversion from UTC to local time should be 
accurate). Various programming languages have libraries to use this 
database.

https://www.iana.org/time-zones

I can not say anything concerning Windows besides that I have seen 
tables for mapping of tzids to IANA timezones.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 16:09                                                           ` Thomas S. Dye
@ 2023-01-20 16:56                                                             ` Max Nikulin
  2023-01-20 20:37                                                               ` Thomas S. Dye
  0 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-20 16:56 UTC (permalink / raw)
  To: emacs-orgmode

On 20/01/2023 23:09, Thomas S. Dye wrote:
> Max Nikulin writes:
> 
> Now, if Amsterdam's timezone 
> arbitrarily changes its relation to UTC before the conference takes 
> place, then everyone who participates in the conference must notice this 
> (or miss the start of the conference).

My point is that if timestamp is stored in UTC than it becomes incorrect 
in the case of time offset change. If such timestamp is stored as local 
time + time zone identifier then application presenting the timestamp to 
users will show correct time as soon as zoneinfo data is updated.

> A virtual conference is organized by 
> someone in Amsterdam, who sets a start time corresponding to 9AM in 
> Amsterdam at a date some years in the future and invites participants 
> from all over the world.  Now, if Amsterdam's timezone arbitrarily 
> changes its relation to UTC before the conference takes place, then must 
> everyone notice this?  Or, should Org, from the time the arbitrary 
> change is made public, simply adjust the conference time for all the 
> participants in the Amsterdam timezone?

Both variants are possible and a planning application should support 
them. It is matter of negotiation between the committee and the 
participants. Timestamp should be stored in UTC only in one case.




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 16:56                                                             ` Max Nikulin
@ 2023-01-20 20:37                                                               ` Thomas S. Dye
  2023-01-21  0:14                                                                 ` Tim Cross
  0 siblings, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-20 20:37 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Aloha Max,

Max Nikulin <manikulin@gmail.com> writes:

> On 20/01/2023 23:09, Thomas S. Dye wrote:
>> Max Nikulin writes:
>> Now, if Amsterdam's timezone 
>> arbitrarily changes its relation to UTC before the conference 
>> takes place,
>> then everyone who participates in the conference must notice 
>> this (or miss the
>> start of the conference).
>
> My point is that if timestamp is stored in UTC than it becomes 
> incorrect in the
> case of time offset change. If such timestamp is stored as local 
> time + time
> zone identifier then application presenting the timestamp to 
> users will show
> correct time as soon as zoneinfo data is updated.
>
>> A virtual conference is organized by someone in Amsterdam, who 
>> sets a start
>> time corresponding to 9AM in Amsterdam at a date some years in 
>> the future and
>> invites participants from all over the world.  Now, if 
>> Amsterdam's timezone
>> arbitrarily changes its relation to UTC before the conference 
>> takes place,
>> then must everyone notice this?  Or, should Org, from the time 
>> the arbitrary 
>> change is made public, simply adjust the conference time for 
>> all the
>> participants in the Amsterdam timezone?
>
> Both variants are possible and a planning application should 
> support them. It is
> matter of negotiation between the committee and the 
> participants. Timestamp
> should be stored in UTC only in one case.

Agreed.  So, IIUC, there are three cases:

1) Occurrence, where the timestamp includes UTC;
2) Event relative to user, where the timestamp does not include 
UTC or a time zone; and 
3) Event not relative to user, where the timestamp includes the 
relevant time zone.

For completeness, Case 3 might benefit from a procedure to change 
the relevant time zone.  For instance, when the boss has scheduled 
time for you at 9:00 AM her time, but doesn't know where she will 
be on that day.

hth,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 11:29           ` Daryl Manning
  2023-01-20 11:36             ` Ihor Radchenko
  2023-01-20 11:39             ` Fraga, Eric
@ 2023-01-20 22:51             ` Tim Cross
  2 siblings, 0 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-20 22:51 UTC (permalink / raw)
  To: Daryl Manning; +Cc: Ihor Radchenko, emacs-orgmode

Daryl Manning <daryl@wakatara.com> writes:

> Perhaps a leading question (leading to outrage =p ), but does anybody even use those anymore? 
>
> I don't believe I've used them at all in 5 years of using org-mode (and if I did it was most likely because of
> some arcane older feature which required them). 
>
> Daryl. 
>
> On Fri, Jan 20, 2023 at 5:57 PM Ihor Radchenko <yantar92@posteo.net> wrote:
>
>  Ihor Radchenko <yantar92@posteo.net> writes:
>
>  > <2023-01-14 Sat 18:22@Asia/Singapore>  (SGD and similar abbreviations are often ambiguous)
>  > <2023-01-14 Sat 18:22+0800>
>  > <2023-01-14 Sat 18:22+08>
>  > <2023-01-14 Sat 18:22@+0800>
>  > <2023-01-14 Sat 18:22@+08>
>
>  One thing we all missed in the discussion is diary sexps.
>
>  In particular, "last Sunday of month" <%%(diary-float t 0)> may depend
>  on the time zone because the number of days in month may vary.
>
>  How can we approach this? What could the format to specify the time zone
>  for diary timestamps?
>
>  -- 
>  Ihor Radchenko // yantar92,
>  Org mode contributor,
>  Learn more about Org mode at <https://orgmode.org/>.
>  Support Org development at <https://liberapay.com/org-mode>,
>  or support my work at <https://liberapay.com/yantar92>

If your speaking about diary sexp support, I don't use them, but I have
seen a number of threads within the last year regarding people wanting
assistance with getting them right and I get the impression for some use
cases, particularly for repeating events, diary seexp specification is
the easiest way to define them.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 15:29                                                           ` Max Nikulin
@ 2023-01-20 22:56                                                             ` Tim Cross
  0 siblings, 0 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-20 22:56 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 20/01/2023 15:11, Tim Cross wrote:
>> Max Nikulin writes:
>> 
>>> Tim, I am trying to say that any meeting either face to face or on-line may be associated
>>> with arbitrary primary timezone.
>> and what you are saying is helpful how? In what way does what you are
>> sayhing help address my use case?
>
> Tim, are you trying to convince me that for Org it is enough to have timestamps either as
> local time <2023-02-20 15:00> or as UTC something like <2023-02-20 05:00Z> and ability to
> specify arbitrary timezone instead of UTC is redundant?
>

No. I have never stated anything like that. 

> I believe that in the case of support of optional arbitrary timezone in Org files there is
> no point of distinction between you cases when all participants meet face to face
> (<2023-02-20 15:00> or <2023-02-20 15:00@Australia/Sydney>) or it is online meeting
> scheduled as <2023-02-20 09:00@Etc/UTC>.

That is all I've been saying! For meetings where everyone is in same
time zone, just use either <yyyyy-mm-dd hh:mm> OR <yyyy-mm-dd hh:ss
<local timezone>> and for meetings where there are participants from
different time zones, use <yyyy-mm-dd hh:mm ETc/UTC>. That simple.

All that remains is to figure out the best interface to make it easy for
the user to have the correct timestamp for the correct meeting type. 

>
>>> UI might offer you to choose time in your timezone and to select another timezone for
>>> storage. For your convenience it still may be presented to you in your local timezone even
>>> it is stored in UTC or some other one.
>> and I have said as much. So, how exactly is your contribution assisting
>> with the use case I've outlined?
>
> I had a hope to assure you that unifying the cases you are considering as distinct should
> not make user experience worse.
>
> Local event and UTC is meaningful for UI to enter or adjust timestamp where such cases
> should be easier to select than arbitrary timezone. For parsing, generating agenda, or
> export a more abstract model can be used.

I really don't understand your continued reference to 'arbitrary
timezone' or how it is relevant. I also am not clear what you mean by
'unifying the cases'. If you mean handling the two different cases in
the same UI, that is exactly what I've been suggesting. If you mean
using the same time zone for both cases, I don't see how that could
possibly work and if you mean something else, I don't understand.

My position is very simple and very specific. Either use no TZ info or
local TZ spec for meetings where all participants are in the same TZ and
ust UTC where you have participants from different TZs. Note that htis
says nothing about how the timestamp is displayed (I would argue for
user's local time using an overlay or similar, like we do for links and
markup) and it says nothing about how the other participants record the
meeting (it is specific to the org user) and it says nothing about other
users for timestamps - only in reference to scheduled events.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 12:17                                                         ` Max Nikulin
  2023-01-20 16:09                                                           ` Thomas S. Dye
@ 2023-01-20 23:38                                                           ` Tim Cross
  2023-01-21  6:21                                                             ` Max Nikulin
  1 sibling, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-20 23:38 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 20/01/2023 15:17, Tim Cross wrote:
>> So far, nobody has shown any reason why using UTC to distinguish the
>> case where the times need to be adjusted and local tz when they don't
>> won't work a a  mechanism that can be used to allow org to handle things
>> better than it does now.
>
> Let's try to move in small steps. UTC as storage format.
>
> An issue with events scheduled as local time in some particular timezone (not your current
> one) and stored as UTC timestamp when IANA tzdata is updated to use new timezone offset:
>
> https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bullet/
> Storing UTC is not a silver bullet
>
> Do you think it should be ignored? I faced such issue.

I now think I can see where you have become confused.

I am NOT arguing that all timestamps should be stored in UTC.

I am only saying that when you have a meeting which is not face to face
and involves people from various time zones, the date+time for that
meeting should be stored in UTC. This is the only way org will be able
to ensure the meeting time (which would be converted into local time for
the user) stays relative to the other participants after a daylight
savings transition.

The use cases here is completely different from the example outlined in
that long article.  Firstly, much of the complications arising in that
example are due to tryhing to coordinate dates and times for multiple
parties. Here we are only focusing on 1 party. Secondly, I am only
proposing UTC for meetings where there is no physical location for the
meeting. In the case where there is a physical location, that is a
fact-to-face meeting and it should be recorded in the time zone of the
location of that meeting. In most cases, that will be the user's local
time zone, so for most face=to=face meetings, no explicit time zone is
necessary as the local time zone will be assumed.

So in summary, my argument is

- Use UTC for meetings which are not face-to-face and which involve
  people form different time zones.

- Use the time zone of the location of a meeting when the meeting is
  face-to-face and has a physical locaiton.

- Provide an interface in org to make it easier for users to select the
  correct format (UTC or lcoal/meeting tz). Exactly the best way to do
  this is yet to be determined. It could be just a general solution
  which allows you to select the TZ when you call the functions with C-u
  or it could be something more sophisticated and specific to booking
  meetings which asks questions (i.e. type of record meeting wiard).

- It is assumed that in most cases, timestamps will b displayed to the
  user in their local time zone regardless of how they are actualy
  recorded int he org file.

I suspect where you have become confused is because you read my first
post in the thread where I suggested using UTC for meetings would be
sufficient. However, I revised that based on responses and then proposed
only using UTC for meetings which are not face-to-face and where
participants are from different time zones. It appears you have missed
those posts. 

I would also argue UTC is good for 'traditional' timestamps which record
a specific point in time and for situations where you want accurate
calculations of time durations. In fact, I would argue that UTC is a
good choice for a majority of time stamps, but acknowledge there are
some situations, notably when scheduling an event with a physical
location, where it is better to use the time zone of the location. 



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 20:37                                                               ` Thomas S. Dye
@ 2023-01-21  0:14                                                                 ` Tim Cross
  2023-01-21  0:37                                                                   ` Thomas S. Dye
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-21  0:14 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Max Nikulin, emacs-orgmode

"Thomas S. Dye" <tsd@tsdye.online> writes:

> Aloha Max,
>
> Max Nikulin <manikulin@gmail.com> writes:
>
>> On 20/01/2023 23:09, Thomas S. Dye wrote:
>>> Max Nikulin writes:
>>> Now, if Amsterdam's timezone arbitrarily changes its relation to UTC before the
>>> conference takes place,
>>> then everyone who participates in the conference must notice this (or miss the
>>> start of the conference).
>>
>> My point is that if timestamp is stored in UTC than it becomes incorrect in the
>> case of time offset change. If such timestamp is stored as local time + time
>> zone identifier then application presenting the timestamp to users will show
>> correct time as soon as zoneinfo data is updated.
>>
>>> A virtual conference is organized by someone in Amsterdam, who sets a start
>>> time corresponding to 9AM in Amsterdam at a date some years in the future and
>>> invites participants from all over the world.  Now, if Amsterdam's timezone
>>> arbitrarily changes its relation to UTC before the conference takes place,
>>> then must everyone notice this?  Or, should Org, from the time the arbitrary change is
>>> made public, simply adjust the conference time for all the
>>> participants in the Amsterdam timezone?
>>
>> Both variants are possible and a planning application should support them. It is
>> matter of negotiation between the committee and the participants. Timestamp
>> should be stored in UTC only in one case.
>
> Agreed.  So, IIUC, there are three cases:
>
> 1) Occurrence, where the timestamp includes UTC;
> 2) Event relative to user, where the timestamp does not include UTC or a time zone; and 3)
> Event not relative to user, where the timestamp includes the relevant time zone.
>

I would argue case 2 is really just a specialisation of case 3 i.e. it
has an implicit time zone which is the user's local time zone. 

> For completeness, Case 3 might benefit from a procedure to change the relevant time zone.
> For instance, when the boss has scheduled time for you at 9:00 AM her time, but doesn't
> know where she will be on that day.
>

If it is to be a fact-to-face meeting (event), implying it therefore has
a location, you would assume your local time zone. If not face-to-face
(occurrence), it needs a UTC offset in order to ensure same point in
time for all participants. The boss either needs to specify the time
zone they are referencing the 9am to or the user will need to make a
guess, which may or may not be correct.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-21  0:14                                                                 ` Tim Cross
@ 2023-01-21  0:37                                                                   ` Thomas S. Dye
  2023-01-21  5:53                                                                     ` Max Nikulin
  0 siblings, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-21  0:37 UTC (permalink / raw)
  To: Tim Cross; +Cc: Thomas S. Dye, Max Nikulin, emacs-orgmode

Aloha Tim,

Tim Cross <theophilusx@gmail.com> writes:

> "Thomas S. Dye" <tsd@tsdye.online> writes:
>
>> Aloha Max,
>>
>> Max Nikulin <manikulin@gmail.com> writes:
>>
>>> On 20/01/2023 23:09, Thomas S. Dye wrote:
>>>> Max Nikulin writes:
>>>> Now, if Amsterdam's timezone arbitrarily changes its relation 
>>>> to UTC before the
>>>> conference takes place,
>>>> then everyone who participates in the conference must notice 
>>>> this (or miss the
>>>> start of the conference).
>>>
>>> My point is that if timestamp is stored in UTC than it becomes 
>>> incorrect in the
>>> case of time offset change. If such timestamp is stored as 
>>> local time + time
>>> zone identifier then application presenting the timestamp to 
>>> users will show
>>> correct time as soon as zoneinfo data is updated.
>>>
>>>> A virtual conference is organized by someone in Amsterdam, 
>>>> who sets a start
>>>> time corresponding to 9AM in Amsterdam at a date some years 
>>>> in the future and
>>>> invites participants from all over the world.  Now, if 
>>>> Amsterdam's timezone
>>>> arbitrarily changes its relation to UTC before the conference 
>>>> takes place,
>>>> then must everyone notice this?  Or, should Org, from the 
>>>> time the arbitrary change is
>>>> made public, simply adjust the conference time for all the
>>>> participants in the Amsterdam timezone?
>>>
>>> Both variants are possible and a planning application should 
>>> support them. It is
>>> matter of negotiation between the committee and the 
>>> participants. Timestamp
>>> should be stored in UTC only in one case.
>>
>> Agreed.  So, IIUC, there are three cases:
>>
>> 1) Occurrence, where the timestamp includes UTC;
>> 2) Event relative to user, where the timestamp does not include 
>> UTC or a time zone; and 3)
>> Event not relative to user, where the timestamp includes the 
>> relevant time zone.
>>
>
> I would argue case 2 is really just a specialisation of case 3 
> i.e. it
> has an implicit time zone which is the user's local time zone. 
>
Case 2 covers things the user wants to do at a particular time, 
regardless of where they are and the time zone they are in.  For a 
repeating task the time zone might change from one instance to the 
next.  It needs to follow the user around and can presumably rely 
on software to keep track of that.

>> For completeness, Case 3 might benefit from a procedure to 
>> change the relevant time zone.
>> For instance, when the boss has scheduled time for you at 9:00 
>> AM her time, but doesn't
>> know where she will be on that day.
>>
>
> If it is to be a fact-to-face meeting (event), implying it 
> therefore has
> a location, you would assume your local time zone. If not 
> face-to-face
> (occurrence), it needs a UTC offset in order to ensure same 
> point in
> time for all participants. The boss either needs to specify the 
> time
> zone they are referencing the 9am to or the user will need to 
> make a
> guess, which may or may not be correct.

Or, it might be a recurring virtual meeting that the boss wants to 
initiate at 9:00 AM her time, regardless of the time zone she 
happens to inhabit, as might happen on a business trip.  Here, the 
virtual meeting is an event because the boss relates it to her own 
space/time.  Inconvenient for employees, but some bosses are like 
that.  Here, the time zone needs to follow the boss around.

My current hypothesis is that the three cases are exhaustive.

All the best,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-21  0:37                                                                   ` Thomas S. Dye
@ 2023-01-21  5:53                                                                     ` Max Nikulin
  2023-01-21 15:55                                                                       ` Thomas S. Dye
  0 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-21  5:53 UTC (permalink / raw)
  To: emacs-orgmode

On 21/01/2023 07:37, Thomas S. Dye wrote:
>>> 1) Occurrence, where the timestamp includes UTC;
>>> 2) Event relative to user, where the timestamp does not include UTC 
>>> or a time zone; and 3)
>>> Event not relative to user, where the timestamp includes the relevant 
>>> time zone.

For a while I prefer to concentrate on future timestamps and postpone 
discussion of ones in the past.

As to format for storage timestamps in Org files, particular timestamps 
may have or not explicitly specified timezones, but it is unrelated to 
these 3 cases. It may be convenient to keep work.org file with TIMEZONE 
keyword for location of the office and do not specify it for each 
timestamps, so during a trip it allows to see correct time of regular 
meetings. In addition you may have personal.org file where most 
timestamps assumes timezone of your current presence. In both files some 
timestamps may have explicit timezone either "local follow me", UTC, or 
for particular location.

 From my point of view these, 3 cases might be relevant to date-time 
picker UI, but not for storage format. While parsing, interpretation of 
each timestamp without explicit timezone depends on preferences chosen 
at higher scope.

> Or, it might be a recurring virtual meeting that the boss wants to 
> initiate at 9:00 AM her time, regardless of the time zone she happens to 
> inhabit, as might happen on a business trip.

I believe that some manual action is required in this case anyway. You 
almost certainly already have 9:00 AM in your agenda as a reoccurring 
timestamp either with implicit or explicit timezone of usual presence. 
For the period of the trip it is necessary to add series of meetings 
with explicitly specified timezones (UTC or locations during the trip). 
Another approach is to define ad hoc "boss" timezone and update it to 
reflect all trips.

At the Org side it might be support of multiple ad hoc "timezones": a 
one for you personal trips and several ones for people you frequently 
communicate with. It is a nice option, but might be too complicated for 
usage. It may be easier to suspend regular entry and to add custom ones 
with no requirements related to the code. Anyway it assumes some 
communication between participants.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 23:38                                                           ` Tim Cross
@ 2023-01-21  6:21                                                             ` Max Nikulin
  2023-01-21 21:29                                                               ` Tim Cross
  0 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-21  6:21 UTC (permalink / raw)
  To: emacs-orgmode

On 21/01/2023 06:38, Tim Cross wrote:
> 
> - Use UTC for meetings which are not face-to-face and which involve
>    people form different time zones.

I agree with you that it should considered as first option by whose who 
are planning an event. They still may prefer to choose timezone of 
particular location because it is mixed meeting with attenders of both 
types: face to face and online, or just because most of on-line 
participants are expected from particular area.

However timezone may be out of your control if you receive invitation to 
join on-line to some meeting. Attempt to convert it to UTC may lead to 
problems. So the reason to choose UTC or specific timezone for 
particular timestamp is not really technical one. It is just decision of 
some people.

Do you have any objection to the following statements:
- UTC is a recommendation for planning when participants are scattered 
over multiple timezones.
- You admit that some timestamps in your files may be specified as time 
zone identifier + local time relative to this zone.
- In both cases you may configure overlays to use local timezone or 
another one whatever you currently find convenient.
- Time chooser offers several time zone options.

> I would also argue UTC is good for 'traditional' timestamps which record
> a specific point in time and for situations where you want accurate
> calculations of time durations.

Mostly agree, so I prefer to postpone discussion of details till 
confirming agreement in respect to future timestamps.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 11:39             ` Fraga, Eric
  2023-01-20 11:48               ` Ihor Radchenko
@ 2023-01-21  9:21               ` Ihor Radchenko
  2023-01-21 10:14                 ` Max Nikulin
  1 sibling, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-21  9:21 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Daryl Manning, emacs-orgmode@gnu.org

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> However, having said this, I don't think it's org's responsibility to
> address the Emacs Diary: that would be a feature request for Emacs more
> generally...

I looked into this further and I note that
`calendar-absolute-from-gregorian' does not account for time zones at
all:

          ((> year 0)
           (setq offset-years (1- year))
           (+ (calendar-day-number date) ; days this year
              (* 365 offset-years)       ; + days in prior years
              (/ offset-years 4)         ; + Julian leap years
              (- (/ offset-years 100))   ; - century years
              (/ offset-years 400)))     ; + Gregorian leap years

Diary sexps are using this function frequently.
In fact, Org also does use this function frequently.

Probably, the only sane way to address all the pitfalls with time zones
while using calendar functions is first converting the date to UTC
before passing it to diary sexps and calendar functions. I hope that UTC
is at least not affected by all the crazy time transitions various time
zones have.

Though I am not sure about the calendar displayed alongside the
`org-read-date'. It ought to be in local time zone, but the above means
that not everything is accounted for by Emacs calendar.

Also, agenda. Things like `org-extend-today-until' may be dramatically
affected if we try to convert things to UTC.

Or should we just bite the bullet and use "local" time zone for agenda
calculations and calendars? It will not be accurate, but I am afraid
that rewriting agenda to support UTC is going to transform into
rewriting agenda completely + rewriting Emacs diary.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-21  9:21               ` Ihor Radchenko
@ 2023-01-21 10:14                 ` Max Nikulin
  2023-01-22 11:49                   ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-21 10:14 UTC (permalink / raw)
  To: emacs-orgmode

On 21/01/2023 16:21, Ihor Radchenko wrote:
> 
> I looked into this further and I note that
> `calendar-absolute-from-gregorian' does not account for time zones at
> all:
> 
>            ((> year 0)
>             (setq offset-years (1- year))
>             (+ (calendar-day-number date) ; days this year
>                (* 365 offset-years)       ; + days in prior years
>                (/ offset-years 4)         ; + Julian leap years
>                (- (/ offset-years 100))   ; - century years
>                (/ offset-years 400)))     ; + Gregorian leap years
> 
> Diary sexps are using this function frequently.
> In fact, Org also does use this function frequently.

I have not look into this package yet, so I can not comment it.

Should we summon Paul Eggert?
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54764#10
Re: bug#54764: encode-time: make DST and TIMEZONE fields of the list
  argument optional ones Sat, 9 Apr 2022 00:52:57 -0700
> Generally speaking, 
> when Org mode is doing calendrical calculations it should use 
> calendrical functions rather than encode-time+decode-time, which are 
> best used for time calculations not calendar calculations.

On 21/01/2023 16:21, Ihor Radchenko wrote:
> Probably, the only sane way to address all the pitfalls with time zones
> while using calendar functions is first converting the date to UTC
> before passing it to diary sexps and calendar functions. I hope that UTC
> is at least not affected by all the crazy time transitions various time
> zones have.

It may be tricky to get start of day / end of day or advance timestamp 
by given number of days having timestamp as seconds since epoch. If you 
mean broken-down time representation in UTC then I am unsure which way 
you are going to handle skipped 2011-12-30 case, since dates in UTC are 
rather regular.

> but I am afraid
> that rewriting agenda to support UTC is going to transform into
> rewriting agenda completely + rewriting Emacs diary.

I still suspect that to implement timezone support in Org it will be 
necessary to create a custom library to handle zoneinfo files.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20 11:48               ` Ihor Radchenko
@ 2023-01-21 12:55                 ` Jean Louis
  2023-01-21 13:41                   ` Ihor Radchenko
  0 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-21 12:55 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Fraga, Eric, Daryl Manning, emacs-orgmode@gnu.org

* Ihor Radchenko <yantar92@posteo.net> [2023-01-20 14:50]:
> Of course, more generally, there is also a question of things like
> calendar displaying time in different time zone (for example, when
> choosing timestamp date and time in `org-read-date').

Also consider that calendar has these options

(setq calendar-location-name
(setq calendar-latitude 
(setq calendar-longitude 
(setq calendar-standard-time-zone-name 
(setq calendar-time-zone 

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19 15:55                                                 ` Thomas S. Dye
@ 2023-01-21 13:10                                                   ` Jean Louis
  2023-01-21 16:23                                                     ` Thomas S. Dye
  2023-01-21 13:50                                                   ` Jean Louis
  1 sibling, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-21 13:10 UTC (permalink / raw)
  To: Thomas S. Dye
  Cc: Tim Cross, Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

* Thomas S. Dye <tsd@tsdye.online> [2023-01-19 19:23]:
> Only occurrences require absolute time, UTC.  Events do not.  They
> follow the user's space/time.

I understand you got your context specific terminology, from the
mentioned book, where you are making philosophically different
distinction between occurence and event as opposed to distinction by
its ordinary meaning in English.

What really matters
-------------------

What matters is aid to users' life.

When arguing, try to make a checklist and TEST it:

- [ ] can user easily understand the time displayed?

- [ ] can user relate the displayed time to his local time without
  hesitation?

- [ ] is that program that programmer creates beneficial to user or to
  programmer, or theoretician of absolutes, rights and wrongs?

How to test it?

Usability Testing 101:
https://www.nngroup.com/articles/usability-testing-101/


Today there is in computing pretty much agreement that:
-------------------------------------------------------

- All computer time should be stored to UTC, UTC being basis for any
  other computations

- System libraries have (or should have) various configurations

- Computer users should be shown their local time


* Overview of noun occurrence
-----------------------------


The noun occurrence has 2 senses (first 2 from tagged texts)
1. (29) happening, occurrence, occurrent, natural event -- (an event that happens)
2. (3) occurrence -- (an instance of something occurring; "a disease of frequent occurrence"; "the occurrence (or presence) of life on other planets")

* Overview of noun event

The noun event has 4 senses (first 2 from tagged texts)
1. (62) event -- (something that happens at a given place and time)
2. (6) event, case -- (a special set of circumstances; "in that event, the first possibility is excluded"; "it may rain in which case the picnic will be canceled")
3. event -- (a phenomenon located at a single point in space-time; the fundamental observational entity in relativity theory)
4. consequence, effect, outcome, result, event, issue, upshot -- (a phenomenon that follows and is caused by some previous phenomenon; "the magnetic effect was greater when the rod was lengthwise"; "his decision had depressing consequences for business"; "he acted very wise after the event")

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-21 12:55                 ` Jean Louis
@ 2023-01-21 13:41                   ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-21 13:41 UTC (permalink / raw)
  To: Jean Louis; +Cc: Fraga, Eric, Daryl Manning, emacs-orgmode@gnu.org

Jean Louis <bugs@gnu.support> writes:

> * Ihor Radchenko <yantar92@posteo.net> [2023-01-20 14:50]:
>> Of course, more generally, there is also a question of things like
>> calendar displaying time in different time zone (for example, when
>> choosing timestamp date and time in `org-read-date').
>
> Also consider that calendar has these options
>
> (setq calendar-location-name
> (setq calendar-latitude 
> (setq calendar-longitude 
> (setq calendar-standard-time-zone-name 
> (setq calendar-time-zone 

Thanks!

32.7 Times of Sunrise and Sunset section of Emacs manual is relevant.
Also, 32.11 Daylight Saving Time. Note that the DST rules appear to be
manual instead of being automatically determined from the TZDB.
Though proper TZDB support is probably something we may eventually need
to ask upstream.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19 15:55                                                 ` Thomas S. Dye
  2023-01-21 13:10                                                   ` Jean Louis
@ 2023-01-21 13:50                                                   ` Jean Louis
  2023-01-21 14:31                                                     ` Max Nikulin
  2023-01-21 16:55                                                     ` Thomas S. Dye
  1 sibling, 2 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-21 13:50 UTC (permalink / raw)
  To: Thomas S. Dye
  Cc: Tim Cross, Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

* Thomas S. Dye <tsd@tsdye.online> [2023-01-19 19:23]:
> Only occurrences require absolute time, UTC.  Events do not.  They follow
> the user's space/time.
> 
> > > > Org in this state can't handle such things.
> > > 
> > > Org can do the useful thing: translate the UTC timestamp into local
> > > time and
> > > report both UTC and local time.  User will be able quickly to
> > > determine if
> > > local time is incorrect for some reason, such as DST or travel.
> > 
> > Other way around, it has to translate time stamp into UTC time in the
> > first place.
> 
> Yes, to store the time stamp, Org must take it from the event time of the
> user and translate it to UTC.  When reporting an occurrence to the user,
> then Org must translate from UTC to the user's space/time.  User might have
> a toggle, like pretty entities, that either shows UTC or translation to
> user's space/time.

That is right. I have stated same.

How do you want Org to know that user's time is in X time zone? 

It means, that new settings, variables, functions, must be introduced
to handle it properly. Timestamp like this one: <2023-01-21 Sat 09:55>
at HTML export will be from 95% and upwards incorrect. To be correct,
time zone designation shall be placed in HTML export. User could be in
South America, not in London, that exports it. Time zone UTC does not
apply for South America. Representation is wrong.

When you say that Org must take it from the event time of the user,
that means that Org must take some parameter to understand what time
zone user was.

That means involving functions for export, or sharing of Org files.

In general, we speak about representation.

You may start making distinctions between "events" and "occurences",
but technically we speak of time stamps which lack relation to time
zone in Org. Whatever you "time stamp" without time zone,
representation of it in other time zone becomes difficult, as it lacks
the fundamental designation of time zone where it was recorded. 

And it does not matter if user records time zones in UTC, or other
time zones.

What matters is designation of time zone.

Parameter must exist, something like "#+TIMEZONE: PST"

As that property is then used by programs to understand time zone of
the file, or task.

In general computers store things in UTC. We are repeatedly discussing
what is already agreed before decades.

What we need in Org is representation in time zones.

All programs work by storing in UTC time zone:
----------------------------------------------

Observe file system:

$ touch MY-FILE
~
$  ls -l |grep MY-FILE 
-rw-r--r--     1 admin input       0 Jan 21 16:21 MY-FILE
~
$ TZ=UTC ls -l |grep MY-FILE 
-rw-r--r--     1 admin input       0 Jan 21 13:21 MY-FILE


UTC is basis for time. There are time zone libraries and calculations.

All that one has to think for Org is representation in familiar local time zone.

> > Expecting that all user among so many various time zones write their
> > time stamps in UTC is not reasonable. Org users are advanced, I know,
> > but majority of note takers with other applications will not even
> > think of different time zones, it is surprise they get when dealing
> > internationally. People are not ready for calculating or even viewing
> > their own time in UTC time zone, unless they are English or Icelandic,
> > Portuguese, or Africans in parts of the West Africa.
> > 
> Org should translate from the user's space/time to absolute time, UTC.  

That is right. So far I am telling same, maybe we think is not.

> The user has to tell Org what is the space/time relationship to
> absolute time.

That is right. I said that long ago. The way to "tell it to Org" is at
export, for Org to recognize it in terms of Lisp 
(or time-stamp-zone heading-time-zone file-time-zone system-time-zone)
whatever comes first, then at any sharing of Org directly to people in
other time zones, and in other uses cases. Such sharing and export
must have variables that help to interpolate time properly in other
zones, and Org shall recognize that time stamp displayed is not in
local time zone and ask user if to show or translate time stamps. Many
options exist.

Best is when it is automatic, as that is usual in many other software.

> Org might use the timezone machinery to suggest a space/time
> relationship to absolute time, and it might warn the user when the
> user's suggested relationship differs from the value reported by the
> timezone machinery.

That is right.

> > > Storing timestamps in UTC solves the interval problem Ihor
> > > raised. Intervals always make sense in absolute time.  Moving them
> > > to event time leads to the insanity Ihor mentioned.
> > 
> > The other way around. Assuming that time stamps are UTC raises
> > problems for all other people:
> > https://upload.wikimedia.org/wikipedia/commons/8/88/World_Time_Zones_Map.png
> > 
> > Org now does not support time stamps, right?
> > 
> > So people write timestamps in their own time zone! Is it right?
> 
> IIUC, Org currently stores events, which are relative to the user's
> space/time.  This works for events, but breaks for occurrences, which
> require absolute time, UTC.

You have got that theory from a book, it is different philosophical
concept that somebody finds useful. 

Though it is not directly related to the problem that Org does not
have time zone representation.

To solve the problem first one has to define it. 

You can call time stamps as you wish. How you call them it does not
matter. 

You can call it "event" or "completed" or "deadline" or "scheduled" or
"occurence", those are types useful for user.

Whatever they are called, local user shall get any time displayed in
local time or with proper time zone designation, so that time may be
displayed or converted to local time.

Nothing will break what designation get introduced in Org.

I mean to introduce variables analogous to following logic:

(or time-stamp-zone heading-time-zone file-time-zone system-time-zone)

> > Thus time stamps already have their time zones, it is just not
> > recorded in Org file.
> 
> Events don't need a time zone, only occurrences need absolute time.

When you introduce words that have different meaning in different
context in your book, you can't expect that it will be generally
expected.

No matter how you "name" the time zone, all time you write in your
computer beyond Org is already written in your local time zone.

Any time user designates in notes, calendars, etc. is already in local
time zone.

Any time displayed to user is in his local time zone.

Follow the steps!

It is that simple.

If event need time zone or not, because you think it does not need,
many others may disagree.

Why argue how you call that time? 

Just follow the steps to display it in local time zone, and any time
to accept as UTC, written in local time zone. Any time always is
related to UTC in computers, there is nothing unsolved.

Finally users who do not want to fiddle with time zone shall also be
left to do so.

Org could also give to user to designate how time stamp should look
like, by using format that user may specify:

%Y/%m/%d - %H:%M %Z

Which could display:

2023/01/21 - 16:40 EAT

by using:
https://linux.die.net/man/3/strftime

instead of trying to satisfy every possible way of formats of time
stamps (congratulation for that).

1. System time is always in local time
2. Org may introduce TIMEZONE property as already discussed
2. Org may introduce property "#+TIMEZONE_FORMAT" like "%Y/%m/%d - %H:%M %Z"
3. Any time stamp would use that format

Translation of timestamps to other time zones by using that format are
easier, than trying to satisfy every person on planet. For Org, which
is not even demanded apart from us here.

> >   :TIMEZONE: EET
> >   :END:
> > 
> > or inside of the time zone.
> > 
> > When such heading is read in Seattle, Washington, Org will tell to
> > user or ask to translate it to PST time.
> > 
> > In such translations, EET time is first converted to UTC, for reason
> > of using system libraries, and not complicating Org, and then
> > converted to PST time zone.
> 
> The Org user in Seattle would either see UTC or toggle to see UTC translated
> to Seattle space/time, assuming user set space/time relationship to UTC
> correctly.  If not, then Org should warn user that the specified
> relationship differs from the one suggested by the timezone
> machinery.

Why would you see UTC if you are not in UTC time zone? It is not
useful. 

But yes, user could or should be able to see it in any time zone, but
without much focus on that. Users can change local time zone, so let
them do that if they want, but displaying local time zone is decades
long standard in computin.

I have various software here, none of it asks me to look at UTC
time. UTC is for computer to calculat, not for human to see, it is not
useful for human unless to those who happen to be in that time zone.

All computer software calculates to and from UTC when showing local
time zone.

We basically speak of "calendar" applications where users need to
share various times. 

Then why not follow what is already successful elsewhere?

3.2.19. Time Zone Identifier | iCalendar (RFC 5545) | RFC Specifications:
https://icalendar.org/iCalendar-RFC-5545/3-2-19-time-zone-identifier.html

This parameter MUST be specified on the "DTSTART", "DTEND", "DUE",
"EXDATE", and "RDATE" properties when either a DATE-TIME or TIME value
type is specified and when the value is neither a UTC or a "floating"
time. Refer to the DATE-TIME or TIME value type definition for a
description of UTC and "floating time" formats. This property
parameter specifies a text value that uniquely identifies the
"VTIMEZONE" calendar component to be used when evaluating the time
portion of the property. The value of the "TZID" property parameter
will be equal to the value of the "TZID" property for the matching
time zone definition. An individual "VTIMEZONE" calendar component
MUST be specified for each unique "TZID" parameter value specified in
the iCalendar object.

The parameter MUST be specified on properties with a DATE-TIME value
if the DATE-TIME is not either a UTC or a "floating" time. Failure to
include and follow VTIMEZONE definitions in iCalendar objects may lead
to inconsistent understanding of the local time at any given location.

Thus in Org, we want to avoid also: "inconsistent understanding" at
any given location. That is why only iCalendar export supports the
conversion. 

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-19 17:57                                           ` Alexander Adolf
@ 2023-01-21 13:51                                             ` Jean Louis
  0 siblings, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-21 13:51 UTC (permalink / raw)
  To: Alexander Adolf
  Cc: Tim Cross, Ihor Radchenko, Daryl Manning, rjhorn, emacs-orgmode

* Alexander Adolf <alexander.adolf@condition-alpha.com> [2023-01-19 20:59]:
> Or to any other timezone. The key point here is that you _do_ specify a
> timezone. Then, everybody can convert that and have it displayed in any
> timezone they find useful.

Concise and very right, thanks!


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-21 13:50                                                   ` Jean Louis
@ 2023-01-21 14:31                                                     ` Max Nikulin
  2023-01-21 16:55                                                     ` Thomas S. Dye
  1 sibling, 0 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-21 14:31 UTC (permalink / raw)
  To: emacs-orgmode

On 21/01/2023 20:50, Jean Louis wrote:
> Parameter must exist, something like "#+TIMEZONE: PST"

Please, stop demonstrating your ignorance. You are repeating it despite 
even this thread have messages explaining that abbreviations are 
ambiguous. You are consistently ignoring warnings posted by other people.

See the following thread:

Neil Jerram to emacs-orgmode. Two problems with export to Google 
calendar. Wed, 7 Dec 2022 11:30:10 +0000. 
https://list.orgmode.org/CAKuG=vti=_1ZSe_AQh_OfrPf7YpBy+U2uUhXc--4GjBUxt=PKA@mail.gmail.com

X-WR-TIMEZONE:BST

Google recognized it as Bangladesh Standard Time instead of British 
Summer Time.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-21  5:53                                                                     ` Max Nikulin
@ 2023-01-21 15:55                                                                       ` Thomas S. Dye
  2023-01-22 12:14                                                                         ` Max Nikulin
  0 siblings, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-21 15:55 UTC (permalink / raw)
  To: emacs-orgmode

Aloha Max,

Max Nikulin <manikulin@gmail.com> writes:

> On 21/01/2023 07:37, Thomas S. Dye wrote:
>>>> 1) Occurrence, where the timestamp includes UTC;
>>>> 2) Event relative to user, where the timestamp does not 
>>>> include UTC or a
>>>> time zone; and 3)
>>>> Event not relative to user, where the timestamp includes the 
>>>> relevant time
>>>> zone.
>
> For a while I prefer to concentrate on future timestamps and 
> postpone discussion
> of ones in the past.

I'm curious to find out how the distinction between past and 
future makes a difference.  

> As to format for storage timestamps in Org files, particular 
> timestamps may have
> or not explicitly specified timezones, but it is unrelated to 
> these 3 cases.

I'm curious to learn the classification unrelated to these three 
cases used to determine when to store UTC and timezone.

> It
> may be convenient to keep work.org file with TIMEZONE keyword 
> for location of
> the office and do not specify it for each timestamps, so during 
> a trip it allows
> to see correct time of regular meetings. In addition you may 
> have personal.org
> file where most timestamps assumes timezone of your current 
> presence. In both
> files some timestamps may have explicit timezone either "local 
> follow me", UTC,
> or for particular location.
>
> From my point of view these, 3 cases might be relevant to 
> date-time picker UI,
> but not for storage format. While parsing, interpretation of 
> each timestamp
> without explicit timezone depends on preferences chosen at 
> higher scope.

I'm curious what these preferences are, or might be.

>
>> Or, it might be a recurring virtual meeting that the boss wants 
>> to initiate at
>> 9:00 AM her time, regardless of the time zone she happens to 
>> inhabit, as might
>> happen on a business trip.
>
> I believe that some manual action is required in this case 
> anyway. You almost
> certainly already have 9:00 AM in your agenda as a reoccurring 
> timestamp either
> with implicit or explicit timezone of usual presence. For the 
> period of the trip
> it is necessary to add series of meetings with explicitly 
> specified timezones
> (UTC or locations during the trip). Another approach is to 
> define ad hoc "boss"
> timezone and update it to reflect all trips.

Agreed.  The boss needs to inform you what her local time will be 
for the meeting by sending you a timestamp with a time zone. 
Ideally, Org would know how to associate the timestamp with a 
recurring item stored locally.

>
> At the Org side it might be support of multiple ad hoc 
> "timezones": a one for
> you personal trips and several ones for people you frequently 
> communicate with.
> It is a nice option, but might be too complicated for usage. It 
> may be easier to
> suspend regular entry and to add custom ones with no 
> requirements related to the
> code. Anyway it assumes some communication between participants.

Nowadays, I am frequently asked by applications to give permission 
for using my location.  When I give it, the application reports 
back with my local postal code, etc.  I'm assuming Org can use 
location to determine my current timezone.

All the best,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-21 13:10                                                   ` Jean Louis
@ 2023-01-21 16:23                                                     ` Thomas S. Dye
  0 siblings, 0 replies; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-21 16:23 UTC (permalink / raw)
  To: Jean Louis
  Cc: Thomas S. Dye, Tim Cross, Ihor Radchenko, Daryl Manning, rjhorn,
	emacs-orgmode

Aloha Jean Louis,

Jean Louis <bugs@gnu.support> writes:

> * Thomas S. Dye <tsd@tsdye.online> [2023-01-19 19:23]:
>> Only occurrences require absolute time, UTC.  Events do not. 
>> They
>> follow the user's space/time.
>
> I understand you got your context specific terminology, from the
> mentioned book, where you are making philosophically different
> distinction between occurence and event as opposed to 
> distinction by
> its ordinary meaning in English.
Ordinary meanings are often polysemous, so context is important. 
A big part of philosophy is limiting the confusion caused by 
polysemy. Ramsey was specifically concerned to distinguish two 
senses of the word event because he was certain that using event 
with this polysemy would sow confusion.   

> What really matters
> -------------------
>
> What matters is aid to users' life.
>
> When arguing, try to make a checklist and TEST it:
>
> - [ ] can user easily understand the time displayed?
>
> - [ ] can user relate the displayed time to his local time 
> without
>   hesitation?
>
> - [ ] is that program that programmer creates beneficial to user 
> or to
>   programmer, or theoretician of absolutes, rights and wrongs?
>
> How to test it?
>
> Usability Testing 101:
> https://www.nngroup.com/articles/usability-testing-101/
>
I'm hopeful that Ramsey's distinction between event and occurrence 
contributes to what really matters.  How that distinction is 
communicated to the user most effectively is an open question, 
IMO.

>
> Today there is in computing pretty much agreement that:
> -------------------------------------------------------
>
> - All computer time should be stored to UTC, UTC being basis for 
> any
>   other computations
>
> - System libraries have (or should have) various configurations
>
> - Computer users should be shown their local time
>
I was thinking that Org timestamps should record the information 
needed to let Org calculate user's local time so it is synchronous 
with other users' local times. This ought to make it possible to 
take into account unforeseen, arbitrary changes in timezone (as 
when a legislative body imposes or rescinds DST) that take place 
between the time an event is scheduled and when it takes place. 
Using absolute time (UTC) stored before the arbitrary change in 
timezone will cause problems.  Of course, arbitrary changes in 
timezone do not affect an occurrence, so storing UTC in this 
instance is correct.

>
> * Overview of noun occurrence
> -----------------------------
>
>
> The noun occurrence has 2 senses (first 2 from tagged texts)
> 1. (29) happening, occurrence, occurrent, natural event -- (an 
> event that happens)
> 2. (3) occurrence -- (an instance of something occurring; "a 
> disease of frequent occurrence"; "the occurrence (or presence) 
> of life on other planets")
>
> * Overview of noun event
>
> The noun event has 4 senses (first 2 from tagged texts)
> 1. (62) event -- (something that happens at a given place and 
> time)
> 2. (6) event, case -- (a special set of circumstances; "in that 
> event, the first possibility is excluded"; "it may rain in which 
> case the picnic will be canceled")
> 3. event -- (a phenomenon located at a single point in 
> space-time; the fundamental observational entity in relativity 
> theory)
> 4. consequence, effect, outcome, result, event, issue, upshot -- 
> (a phenomenon
> that follows and is caused by some previous phenomenon; "the 
> magnetic effect was
> greater when the rod was lengthwise"; "his decision had 
> depressing consequences
> for business"; "he acted very wise after the event")

Yes, you can see all the polysemy.  Also, you can see why Ramsey 
was happy with event, and less so with occurrence.  The important 
point is the distinction he proposed, not the words used to 
express it.  I think the distinction is germane to understanding 
what information is needed to let Org calculate user's local time 
so it is synchronous with other users' local times.  To my mind, 
it helps bring order out of complexity.

All the best,
Tom
-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-21 13:50                                                   ` Jean Louis
  2023-01-21 14:31                                                     ` Max Nikulin
@ 2023-01-21 16:55                                                     ` Thomas S. Dye
  1 sibling, 0 replies; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-21 16:55 UTC (permalink / raw)
  To: Jean Louis
  Cc: Thomas S. Dye, Tim Cross, Ihor Radchenko, Daryl Manning, rjhorn,
	emacs-orgmode

Aloha Jean Louis,

Jean Louis <bugs@gnu.support> writes:

> * Thomas S. Dye <tsd@tsdye.online> [2023-01-19 19:23]:
>> Only occurrences require absolute time, UTC.  Events do not. 
>> They follow
>> the user's space/time.
>> 
>> > > > Org in this state can't handle such things.
>> > > 
>> > > Org can do the useful thing: translate the UTC timestamp 
>> > > into local
>> > > time and
>> > > report both UTC and local time.  User will be able quickly 
>> > > to
>> > > determine if
>> > > local time is incorrect for some reason, such as DST or 
>> > > travel.
>> > 
>> > Other way around, it has to translate time stamp into UTC 
>> > time in the
>> > first place.
>> 
>> Yes, to store the time stamp, Org must take it from the event 
>> time of the
>> user and translate it to UTC.  When reporting an occurrence to 
>> the user,
>> then Org must translate from UTC to the user's space/time. 
>> User might have
>> a toggle, like pretty entities, that either shows UTC or 
>> translation to
>> user's space/time.
>
> That is right. I have stated same.
>
> How do you want Org to know that user's time is in X time zone? 
>
> It means, that new settings, variables, functions, must be 
> introduced
> to handle it properly. Timestamp like this one: <2023-01-21 Sat 
> 09:55>
> at HTML export will be from 95% and upwards incorrect. To be 
> correct,
> time zone designation shall be placed in HTML export. User could 
> be in
> South America, not in London, that exports it. Time zone UTC 
> does not
> apply for South America. Representation is wrong.
>
> When you say that Org must take it from the event time of the 
> user,
> that means that Org must take some parameter to understand what 
> time
> zone user was.
>
> That means involving functions for export, or sharing of Org 
> files.
>
> In general, we speak about representation.
>
> You may start making distinctions between "events" and 
> "occurences",
> but technically we speak of time stamps which lack relation to 
> time
> zone in Org. Whatever you "time stamp" without time zone,
> representation of it in other time zone becomes difficult, as it 
> lacks
> the fundamental designation of time zone where it was recorded. 
>
> And it does not matter if user records time zones in UTC, or 
> other
> time zones.
>
Here is a distinction that I think is important based on Ramsey's 
distinction between event and occurrence: UTC is absolute time and 
not a timezone.  UTC doesn't occupy a region of space/time, as 
does a timezone.  This is why UTC can be used to generate 
synchronous times for occurrences, but timezones are required to 
generate synchronous times for events.

hth,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-21  6:21                                                             ` Max Nikulin
@ 2023-01-21 21:29                                                               ` Tim Cross
  2023-01-22  5:50                                                                 ` UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode) Max Nikulin
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-21 21:29 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 21/01/2023 06:38, Tim Cross wrote:
>> - Use UTC for meetings which are not face-to-face and which involve
>>    people form different time zones.
>
> I agree with you that it should considered as first option by whose who are planning an
> event. They still may prefer to choose timezone of particular location because it is mixed
> meeting with attenders of both types: face to face and online, or just because most of
> on-line participants are expected from particular area.
>
> However timezone may be out of your control if you receive invitation to join on-line to
> some meeting. Attempt to convert it to UTC may lead to problems. So the reason to choose
> UTC or specific timezone for particular timestamp is not really technical one. It is just
> decision of some people.
>
> Do you have any objection to the following statements:
> - UTC is a recommendation for planning when participants are scattered over multiple
>  timezones.
> - You admit that some timestamps in your files may be specified as time zone identifier +
>  local time relative to this zone.
> - In both cases you may configure overlays to use local timezone or another one whatever
>  you currently find convenient.
> - Time chooser offers several time zone options.
>

That seems to be in-line with what I was arguing, so yes, would agree.



>> I would also argue UTC is good for 'traditional' timestamps which record
>> a specific point in time and for situations where you want accurate
>> calculations of time durations.
>
> Mostly agree, so I prefer to postpone discussion of details till confirming agreement in
> respect to future timestamps.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-21 21:29                                                               ` Tim Cross
@ 2023-01-22  5:50                                                                 ` Max Nikulin
  2023-01-22  6:17                                                                   ` Thomas S. Dye
  2023-01-22  7:48                                                                   ` Tim Cross
  0 siblings, 2 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-22  5:50 UTC (permalink / raw)
  To: emacs-orgmode

On 22/01/2023 04:29, Tim Cross wrote:
> Max Nikulin writes:
>> - UTC is a recommendation for planning when participants are scattered over multiple
>>   timezones.
>> - You admit that some timestamps in your files may be specified as time zone identifier +
>>   local time relative to this zone.
>> - In both cases you may configure overlays to use local timezone or another one whatever
>>   you currently find convenient.
>> - Time chooser offers several time zone options.
> 
> That seems to be in-line with what I was arguing, so yes, would agree.

Great. At this stage my goal is to convince people that local time and 
UTC for future timestamps are not enough for real life use cases. 
Arbitrary timezone may be crucial to arrive at proper time despite it 
matters in rare cases. My concern is mostly storage format, timestamp 
syntax in Org files.

On 21/01/2023 06:38, Tim Cross wrote:
>>> I would also argue UTC is good for 'traditional' timestamps which record
>>> a specific point in time and for situations where you want accurate
>>> calculations of time durations.

Let's consider the following timestamp

[2023-01-22 Sun 08:29@+1100]

"@" is unimportant here, I take it from Ihor's examples. This timestamp 
is from the "Date:" header of your message. It is not UTC, but in my 
opinion it is equally precise (disregarding seconds) to a UTC timestamp.

Would you prefer to have timestamps in your files in such form or as

[2023-01-21 Sat 21:29Z] ([2023-01-21 Sat 21:29@UTC], [2023-01-21 Sat 
21:29@+00:00], etc)?

Maybe [@1674336588] (seconds since epoch)?

I consider storage format as a part of Org UI, so I believe that 
[2023-01-22 Sun 08:29@+1100] with offset of the usual time zone is more 
convenient than [2023-01-21 Sat 21:29@+0000]. Overlays may present your 
local time in both cases, but raw value with usual offset is easier to 
comprehend.

When a file is shared by a group of people spread across the globe, they 
are free to use UTC or another fixed timezone or do not care at all 
concerning particular offset, it just should present.

Postgres has a reason to insist on UTC since timestamps are stored in 
binary format as microseconds since epoch. It is important for 
performance and there is no room to specify offset. Org has to parse 
timestamps from strings anyway, so it is better to use format more 
convenient for humans.

A side note. In my opinion, *by default* timestamps should be created in 
local time with no offset or timezone. There are should be some 
preferences to enable absolute timestamps and a function to fix offsets 
or timezone identifiers for existing timestamp when the user realizes 
that they become necessary (e.g. before a trip).

So I do not see any advantages of UTC in comparison to time offset 
specific to particular time zone, usually user's local one. My vote is 
[2023-01-22 Sun 08:29@+1100] and not [2023-01-21 Sat 21:29@UTC] (of 
course, only in cases when identifiers like Australia/Sydney do not 
matter) with a configuration option with timezone used fix offsets in 
stored timestamps.




^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-22  5:50                                                                 ` UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode) Max Nikulin
@ 2023-01-22  6:17                                                                   ` Thomas S. Dye
  2023-01-22  8:35                                                                     ` Max Nikulin
  2023-01-22  7:48                                                                   ` Tim Cross
  1 sibling, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-22  6:17 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Aloha Max,

Max Nikulin <manikulin@gmail.com> writes:

> Let's consider the following timestamp
>
> [2023-01-22 Sun 08:29@+1100]
>
> "@" is unimportant here, I take it from Ihor's examples. This 
> timestamp is from
> the "Date:" header of your message. It is not UTC, but in my 
> opinion it is
> equally precise (disregarding seconds) to a UTC timestamp.
>
> Would you prefer to have timestamps in your files in such form 
> or as
>
> [2023-01-21 Sat 21:29Z] ([2023-01-21 Sat 21:29@UTC], [2023-01-21 
> Sat
> 21:29@+00:00], etc)?
>
> Maybe [@1674336588] (seconds since epoch)?
>
> I consider storage format as a part of Org UI, so I believe that 
> [2023-01-22 Sun
> 08:29@+1100] with offset of the usual time zone is more 
> convenient than
> [2023-01-21 Sat 21:29@+0000]. Overlays may present your local 
> time in both
> cases, but raw value with usual offset is easier to comprehend.
>
> When a file is shared by a group of people spread across the 
> globe, they are
> free to use UTC or another fixed timezone or do not care at all 
> concerning
> particular offset, it just should present.

UTC is not a timezone.  It is absolute time.

> Postgres has a reason to insist on UTC since timestamps are 
> stored in binary
> format as microseconds since epoch. It is important for 
> performance and there is
> no room to specify offset. Org has to parse timestamps from 
> strings anyway, so
> it is better to use format more convenient for humans.

Agreed.

> A side note. In my opinion, *by default* timestamps should be 
> created in local
> time with no offset or timezone. There are should be some 
> preferences to enable
> absolute timestamps and a function to fix offsets or timezone 
> identifiers for
> existing timestamp when the user realizes that they become 
> necessary (e.g.
> before a trip).

I don't think there should be a default.  If I'm correct that 
occurrences, events relative to user, and events not relative to 
user exhaustively classify the possibilities, then Org should 
insist that timestamps conform to one of these three 
possibilities.  If the classification is complete, then there is 
no need for a catch-all default.

> So I do not see any advantages of UTC in comparison to time 
> offset specific to
> particular time zone, usually user's local one. My vote is 
> [2023-01-22 Sun
> 08:29@+1100] and not [2023-01-21 Sat 21:29@UTC] (of course, only 
> in cases when
> identifiers like Australia/Sydney do not matter) with a 
> configuration option
> with timezone used fix offsets in stored timestamps.

The disadvantage of time offset specific to a particular timezone 
is that the timezone offset wrt UTC can change arbitrarily. This 
is a potential problem if the arbitrary change takes place between 
the creation of the timestamp and the happening it identifies.  In 
contrast, UTC is guaranteed not to change.  It is not a timezone, 
it is absolute time, a pure continuum.  It is a requirement of 
occurrences.

I'm not sure offset is necessary for events, given that offset can 
change arbitrarily.  WDYT?  It seems to me that once an event has 
been tied to a particular time in a particular time zone that 
Org's job is to take into account changes to that timezone, such 
as DST and arbitrary legislation.  These changes in the event's 
timezone need to be propagated through the schedule for each user, 
so it is possible to synchronize local timestamps around the 
globe.

All the best,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-22  5:50                                                                 ` UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode) Max Nikulin
  2023-01-22  6:17                                                                   ` Thomas S. Dye
@ 2023-01-22  7:48                                                                   ` Tim Cross
  2023-01-24 17:09                                                                     ` Max Nikulin
  1 sibling, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-22  7:48 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 22/01/2023 04:29, Tim Cross wrote:
>> Max Nikulin writes:
>>> - UTC is a recommendation for planning when participants are scattered over multiple
>>>   timezones.
>>> - You admit that some timestamps in your files may be specified as time zone identifier +
>>>   local time relative to this zone.
>>> - In both cases you may configure overlays to use local timezone or another one whatever
>>>   you currently find convenient.
>>> - Time chooser offers several time zone options.
>> That seems to be in-line with what I was arguing, so yes, would agree.
>
> Great. At this stage my goal is to convince people that local time and UTC for future
> timestamps are not enough for real life use cases. Arbitrary timezone may be crucial to
> arrive at proper time despite it matters in rare cases. My concern is mostly storage
> format, timestamp syntax in Org files.
>
> On 21/01/2023 06:38, Tim Cross wrote:
>>>> I would also argue UTC is good for 'traditional' timestamps which record
>>>> a specific point in time and for situations where you want accurate
>>>> calculations of time durations.
>
> Let's consider the following timestamp
>
> [2023-01-22 Sun 08:29@+1100]
>
> "@" is unimportant here, I take it from Ihor's examples. This timestamp is from the
> "Date:" header of your message. It is not UTC, but in my opinion it is equally precise
> (disregarding seconds) to a UTC timestamp.
>
> Would you prefer to have timestamps in your files in such form or as
>
> [2023-01-21 Sat 21:29Z] ([2023-01-21 Sat 21:29@UTC], [2023-01-21 Sat 21:29@+00:00], etc)?
>
> Maybe [@1674336588] (seconds since epoch)?
>

It really depends on what the timestamp is for as to what my preference
would be.  For example, timestamp for an email message is likely best as
your initial example or date with remote senders TZ. Timestamp for a log
record I would probably want <YYYY-MM-DD HH:MM Z> or one of the
variants because the most common way I use those types of timestamp is
in diagnosing problems and comparing revords from various locations
where I don't care about the local time where the record was generated,
but with when it occurred in relation to other log recores.  

> I consider storage format as a part of Org UI, so I believe that [2023-01-22 Sun
> 08:29@+1100] with offset of the usual time zone is more convenient than [2023-01-21 Sat
> 21:29@+0000]. Overlays may present your local time in both cases, but raw value with usual
> offset is easier to comprehend.
>

I would argue that all depends on how you use the information. My org
files are consumed by me (reading) and by scripts, elisp and other
programs. 

> When a file is shared by a group of people spread across the globe, they are free to use
> UTC or another fixed timezone or do not care at all concerning particular offset, it just
> should present.
>

Guess I agree, but this is such a rare/small use case, I really don't
consider it terribly relevant. While I do share data relating to
projects I work on with others, I am the only one who uses org mode and
I suspect I'm the only one who uses Emacs. Sharing org mode files simply
isn't a use case I need to worry about and sharing timestamp data from
those files is rare as well - if I do need to, they will likely be
processed into some other more standard format anyway. 

> Postgres has a reason to insist on UTC since timestamps are stored in binary format as
> microseconds since epoch. It is important for performance and there is no room to specify
> offset. Org has to parse timestamps from strings anyway, so it is better to use format
> more convenient for humans.
>

Again, depends on the use case and how you use the data. 

> A side note. In my opinion, *by default* timestamps should be created in local time with
> no offset or timezone. There are should be some preferences to enable absolute timestamps
> and a function to fix offsets or timezone identifiers for existing timestamp when the user
> realizes that they become necessary (e.g. before a trip).
>
> So I do not see any advantages of UTC in comparison to time offset specific to particular
> time zone, usually user's local one. My vote is [2023-01-22 Sun 08:29@+1100] and not
> [2023-01-21 Sat 21:29@UTC] (of course, only in cases when identifiers like
> Australia/Sydney do not matter) with a configuration option with timezone used fix offsets
> in stored timestamps.

My preference is for a timestamp syntax which lets the user select the
format they want and not attempt to restrict it more than that. Provided
you can specify timestamp with and without TZ information and you
support full and abbreviated time zone names as well as UTC, I don't
think it mattters - let the user choose what suits them best. I
definitely have use cases where timestamp in UTC is the most convenient
format. 

My default would be without time zones, but enable easy adding of
timezones when needed e.g. by calling the function with C-u.

The availability of configurable display overlays would be very useful,
but you also need to be able to turn that off easily and you probably
need an easy way to temporarily update/change the overlay format. 



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-22  6:17                                                                   ` Thomas S. Dye
@ 2023-01-22  8:35                                                                     ` Max Nikulin
  2023-01-22 16:54                                                                       ` Thomas S. Dye
  0 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-22  8:35 UTC (permalink / raw)
  To: emacs-orgmode

Thomas, notice that I resumed a postponed earlier part of discussion 
related to timestamps in the past. Offset from UTC is almost always well 
defined this case.

My perception is that discussing timestamps in future, we came to 
agreement with Tom that timestamps can be specified with timezone 
<2024-02-22 08:29@Australia/Sydney>, in UTC <2024-02-21
21:29@UTC>, or in local timezone <2024-02-22 08:29>

Now I had a hope to convince at least some participants that explicit 
time offset may be used interchangeably with UTC. It is applicable to 
timestamps in the past and to future timestamps when the person who 
created appointment respects remote participants, so decided to rule out 
DST and fix absolute time.

On 22/01/2023 13:17, Thomas S. Dye wrote:
> 
> UTC is not a timezone.  It is absolute time.

I do not see any point to consider UTC too special.

Both timestamps [2023-01-21 Sat 21:29@UTC] and [2023-01-22 Sun 
08:29@+1100] specify absolute time. "+1100" means 11 hours, not 
particular location. Do you have an example of a case where I am wrong?

I use the term "time zone" as a set of rules how to calculate offset at 
particular time moment. UTC is a degenerate case of fixed zero offset. 
In this sense "+11:00" is not a timezone, it is time offset. Several 
time zones (as set of rules) may have such offset at some specific time 
moments including "Etc/GMT-11" that is a timezone.

>> A side note. In my opinion, *by default* timestamps should be created 
>> in local
>> time with no offset or timezone. There are should be some preferences 
>> to enable
>> absolute timestamps and a function to fix offsets or timezone 
>> identifiers for
>> existing timestamp when the user realizes that they become necessary 
>> (e.g.
>> before a trip).
> 
> I don't think there should be a default.

Unfortunately hard choice of default value or behavior is unavoidable 
during development of software. Consider a user who just have installed 
Org. Till it is explicitly configured, perhaps it is better to add e.g. 
clocking entries without offset or timezone assuming local time. It 
should be possible to change it later.

>> So I do not see any advantages of UTC in comparison to time offset 
>> specific to
>> particular time zone, usually user's local one. My vote is [2023-01-22 
>> Sun
>> 08:29@+1100] and not [2023-01-21 Sat 21:29@UTC] (of course, only in 
>> cases when
>> identifiers like Australia/Sydney do not matter) with a configuration 
>> option
>> with timezone used fix offsets in stored timestamps.
> 
> The disadvantage of time offset specific to a particular timezone is 
> that the timezone offset wrt UTC can change arbitrarily. This is a 
> potential problem if the arbitrary change takes place between the 
> creation of the timestamp and the happening it identifies.  In contrast, 
> UTC is guaranteed not to change.  It is not a timezone, it is absolute 
> time, a pure continuum.  It is a requirement of occurrences.

I consider the case when offset is already known because it is a time 
moment in the past. Besides rare corner cases offset can be considered 
as a part of authoritative data. Timestamps like [2023-01-22 Sun 
08:29@+1100] can be unambiguously mapped to UTC.

> I'm not sure offset is necessary for events, given that offset can 
> change arbitrarily.  WDYT?  It seems to me that once an event has been 
> tied to a particular time in a particular time zone that Org's job is to 
> take into account changes to that timezone, such as DST and arbitrary 
> legislation.  These changes in the event's timezone need to be 
> propagated through the schedule for each user, so it is possible to 
> synchronize local timestamps around the globe.

For timestamp in the past offsets simplifies calculation of duration. 
Offsets may be used to fix absolute time before changing location when 
time zone was omitted. Perhaps I will add more in another part of this 
thread.

After all, for a person in Berlin [2023-01-22 Sun 08:29@+1100] may tell 
more than [2023-01-22 Sun 08:29@Australia/Sydney].



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-21 10:14                 ` Max Nikulin
@ 2023-01-22 11:49                   ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-22 11:49 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

>> Diary sexps are using this function frequently.
>> In fact, Org also does use this function frequently.
>
> I have not look into this package yet, so I can not comment it.
>
> Should we summon Paul Eggert?
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54764#10
> Re: bug#54764: encode-time: make DST and TIMEZONE fields of the list
>   argument optional ones Sat, 9 Apr 2022 00:52:57 -0700

I am not sure. Maybe. The package in question is calendar. I can see
that Paul is the author of cal-dst.el. So, he might provide some
insights and non-obvious gotchas.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-21 15:55                                                                       ` Thomas S. Dye
@ 2023-01-22 12:14                                                                         ` Max Nikulin
  2023-01-22 13:35                                                                           ` Thomas S. Dye
  2023-01-22 14:09                                                                           ` Max Nikulin
  0 siblings, 2 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-22 12:14 UTC (permalink / raw)
  To: emacs-orgmode

On 21/01/2023 22:55, Thomas S. Dye wrote:
> Aloha Max,
> 
> Max Nikulin <manikulin@gmail.com> writes:
> 
>> On 21/01/2023 07:37, Thomas S. Dye wrote:
>>>>> 1) Occurrence, where the timestamp includes UTC;
>>>>> 2) Event relative to user, where the timestamp does not include UTC 
>>>>> or a
>>>>> time zone; and 3)
>>>>> Event not relative to user, where the timestamp includes the 
>>>>> relevant time
>>>>> zone.
> 
> I'm curious to find out how the distinction between past and future 
> makes a difference.

For timestamps in the past "absolute" time is almost always known, so 
beside timezone identifiers like Australia/Sydney it is possible to use 
UTC or fixed offset 2023-01-21 Sat 05:55:54 -1000. If a timestamp in 
future is bound to specific timezone then its identifier must be used 
since the government may change time offset. Of course there are cases 
when UTC or timestamps with fixed offsets are used as well: e.g. Lunar 
eclipse or participants with multiple locations are expected.

So it is "feature" of some timestamps in future that attempt to store 
them in UTC may lead to their invalidation later.

>> As to format for storage timestamps in Org files, particular 
>> timestamps may have
>> or not explicitly specified timezones, but it is unrelated to these 3 
>> cases.
> 
> I'm curious to learn the classification unrelated to these three cases 
> used to determine when to store UTC and timezone.
...
>> From my point of view these, 3 cases might be relevant to date-time 
>> picker UI,
>> but not for storage format. While parsing, interpretation of each 
>> timestamp
>> without explicit timezone depends on preferences chosen at higher scope.
> 
> I'm curious what these preferences are, or might be.

Is the following timestamp is in user local timezone or in UTC?

<2023-02-01 Wed 15:00>

If features like the following is implemented then it will not be in 
local time zone:
- file-local
   #+TIMEZONE: UTC
   or
   #+TIMEZONE: Australia/Sydney
- subtree-local
   * H1
   :PROPERTIES:
   :TIMEZONE: Australia/Sydney
   :END:

So looking at such timestamp it would be hard to choose particular case 
from the set you proposed.

Of course it leads to tricky cases when some timestamp is copied to a 
scope with another time zone. It requires some yank handler and text 
properties. When timezone is added to a subtree, perhaps, all timestamps
inside may need to be changed from implicit timezone.

For storage format I would use another types
- explicit/implicit time zone
- Specific timezone/fixed offset. UTC and Etc/GMT-11 zones are identical 
to +0000 and +1100 offsets accordingly.

For UI it is better to choose some terms to make the manual and UI 
dialogues more clear.

I am not a native English speaker and terms "event", "occurrence" sounds 
confusing for me. E.g. a conference is an event. A regular meeting (even 
when scheduled in another time zone) or "brush teeth" are more close to 
occurrence. As soon as you have to split "event" category into 2 parts 
perhaps it is better to pick 3 different names. I may ask for fourth 
that is absolute, but not UTC, but I would prefer to not insist on 
namely UTC and use fixed offset instead.

For UI it is meaningful to name
- default time zone for this scope (with a hint if it is currently 
system-wide, file-local, or specific to subtree), so no explicit 
timezone will be set.
- absolute (UTC or fixed offset) preferred for global event
- bound to location (e.g. Australia/Sydney)
- ad-hoc timezone that follows user in their trips (close to Ramsey's 
"occurrence").

The problem is to push users to timezone identifiers for future 
timestamps associated with some location. Offsets must be discouraged 
this case, but encouraged for on-line meetings. For past timestamps 
particular choice is less important. That is why I separated future/past 
timestamps.

> Agreed.  The boss needs to inform you what her local time will be for 
> the meeting by sending you a timestamp with a time zone. Ideally, Org 
> would know how to associate the timestamp with a recurring item stored 
> locally.

Unsure it it may be implemented reliably.

> Nowadays, I am frequently asked by applications to give permission for 
> using my location.  When I give it, the application reports back with my 
> local postal code, etc.  I'm assuming Org can use location to determine 
> my current timezone.

libc has a concept of timezone. I think, it should be the primary 
source. It is initialized on application startup (roughly) from 
system-wide settings, may be overridden by TZ environment and changed 
later by setting another value of TZ. The problem is that identifier 
like "Australia/Sydney" is considered implementation specific and is not 
directly accessible from the code, it is sealed inside the library. 
Another issue is that I do not know if Emacs is able to receive 
notifications on change of system-wide timezone.

Web-application may request time zone settings from the browser:
     new Intl.DateTimeFormat().resolvedOptions().timeZone

Android devices may have outdated and incomplete zoneinfo database. This 
case either computations should be performed on the server or tzdata 
copy should be bundled into the app.

Client-server application may use resources maintained on servers, emacs 
must be able to run off-line and enough user will be unhappy noticed 
some outgoing queries.

Ubuntu installer or e.g. Google relies on GeoIP databases.

Geodata for timezones is available, but laptops or desktops mostly do 
not have GPS receivers. IP behind NAT is not useful to determine location.

It is possible to make GeoIP database (quality of ones available for 
free are not high) and map of timezones, but I do not think it is 
reasonable.

I suppose, system timezone would be enough for Org. Third party packages 
might implement another way.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-22 12:14                                                                         ` Max Nikulin
@ 2023-01-22 13:35                                                                           ` Thomas S. Dye
  2023-01-22 14:09                                                                           ` Max Nikulin
  1 sibling, 0 replies; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-22 13:35 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Aloha Max,

Max Nikulin <manikulin@gmail.com> writes:

> On 21/01/2023 22:55, Thomas S. Dye wrote:
>> Aloha Max,
>>
>> Max Nikulin <manikulin@gmail.com> writes:
>>
>>> On 21/01/2023 07:37, Thomas S. Dye wrote:
>>>>>> 1) Occurrence, where the timestamp includes UTC;
>>>>>> 2) Event relative to user, where the timestamp does not 
>>>>>> include UTC
>>>>>> or a
>>>>>> time zone; and 3)
>>>>>> Event not relative to user, where the timestamp includes 
>>>>>> the
>>>>>> relevant time
>>>>>> zone.
>>
>> I'm curious to find out how the distinction between past and 
>> future
>> makes a difference.
>
> For timestamps in the past "absolute" time is almost always 
> known, so
> beside timezone identifiers like Australia/Sydney it is possible 
> to use
> UTC or fixed offset 2023-01-21 Sat 05:55:54 -1000. If a 
> timestamp in
> future is bound to specific timezone then its identifier must be 
> used
> since the government may change time offset. Of course there are 
> cases
> when UTC or timestamps with fixed offsets are used as well: e.g. 
> Lunar
> eclipse or participants with multiple locations are expected.

Yes, of course!

FYI, lunar eclipse was Ramsey's example of an occurrence, which 
has to do with changes in the relations of things at a time.

>
> So it is "feature" of some timestamps in future that attempt to 
> store
> them in UTC may lead to their invalidation later.

Yes, these are events, which are relative to a timezone, either 
implicit or explicit.

>
>>> As to format for storage timestamps in Org files, particular
>>> timestamps may have
>>> or not explicitly specified timezones, but it is unrelated to 
>>> these 3
>>> cases.
>>
>> I'm curious to learn the classification unrelated to these 
>> three cases
>> used to determine when to store UTC and timezone.
> ...
>>> From my point of view these, 3 cases might be relevant to 
>>> date-time
>>> picker UI,
>>> but not for storage format. While parsing, interpretation of 
>>> each
>>> timestamp
>>> without explicit timezone depends on preferences chosen at 
>>> higher scope.
>>
>> I'm curious what these preferences are, or might be.
>
> Is the following timestamp is in user local timezone or in UTC?
>
> <2023-02-01 Wed 15:00>
>
> If features like the following is implemented then it will not 
> be in
> local time zone:
> - file-local
>
>    #+TIMEZONE: UTC
>    or
>
>    #+TIMEZONE: Australia/Sydney
> - subtree-local
>
>    * H1
>    :PROPERTIES:
>    :TIMEZONE: Australia/Sydney
>    :END:
>
> So looking at such timestamp it would be hard to choose 
> particular case
> from the set you proposed.
>
This might be a feature, not a bug.  A timestamp that does not 
indicate absolute time (UTC or fixed offset) and does not include 
a timezone relies on the timezone set by user.  So user changes 
timezone preference during trips and these timestamps become 
relative to user's local time.

A timestamp with absolute time or with a timezone would ignore 
user's timezone preference.

> Of course it leads to tricky cases when some timestamp is copied 
> to a
> scope with another time zone. It requires some yank handler and 
> text
> properties. When timezone is added to a subtree, perhaps, all 
> timestamps
> inside may need to be changed from implicit timezone.
>
Perhaps the solution here is to consider this a feature, not a 
bug.  When displaying an event timestamp, the timezone should 
always be indicated.  For an event relative to user, this would be 
the preference currently in scope.  For an event not relative to 
user, the timezone will be part of the timestamp.

> For storage format I would use another types
> - explicit/implicit time zone
Yes, explicit for events not relative to user, implicit for events 
relative to user.

> - Specific timezone/fixed offset. UTC and Etc/GMT-11 zones are 
> identical
> to +0000 and +1100 offsets accordingly.

Here, absolute time is best, either UTC or fixed offset from UTC 
(don't underestimate legislators' folly changing timezones).
>
> For UI it is better to choose some terms to make the manual and 
> UI
> dialogues more clear.

Agreed, though I don't have suggestions atm.

> I am not a native English speaker and terms "event", 
> "occurrence" sounds
> confusing for me. E.g. a conference is an event. A regular 
> meeting (even
> when scheduled in another time zone) or "brush teeth" are more 
> close to
> occurrence. As soon as you have to split "event" category into 2 
> parts
> perhaps it is better to pick 3 different names. I may ask for 
> fourth
> that is absolute, but not UTC, but I would prefer to not insist 
> on
> namely UTC and use fixed offset instead.
>
Yes, UTC and fixed offset (from UTC) are two ways of specifying 
absolute time.  Neither one refers to a timezone.

> For UI it is meaningful to name
> - default time zone for this scope (with a hint if it is 
> currently
> system-wide, file-local, or specific to subtree), so no explicit
> timezone will be set.
> - absolute (UTC or fixed offset) preferred for global event
> - bound to location (e.g. Australia/Sydney)
> - ad-hoc timezone that follows user in their trips (close to 
> Ramsey's
> "occurrence").

I think the first and last can be considered identical (see 
above).

Also note that ad-hoc timezone is an event because it specifies a 
timezone, which is a space/time unit.

> The problem is to push users to timezone identifiers for future
> timestamps associated with some location. Offsets must be 
> discouraged
> this case, but encouraged for on-line meetings. For past 
> timestamps
> particular choice is less important. That is why I separated 
> future/past
> timestamps.
>
Yes, good point.

>> Agreed.  The boss needs to inform you what her local time will 
>> be for
>> the meeting by sending you a timestamp with a time zone. 
>> Ideally, Org
>> would know how to associate the timestamp with a recurring item 
>> stored
>> locally.
>
> Unsure it it may be implemented reliably.
Then Org user must understand that repeating timestamp for an 
event not relative to user is fixed to one timezone and is not 
appropriate for an event that might change timezones, as when the 
boss travels but insists on fixing staff meeting to her local 
time.

>
>> Nowadays, I am frequently asked by applications to give 
>> permission for
>> using my location.  When I give it, the application reports 
>> back with my
>> local postal code, etc.  I'm assuming Org can use location to 
>> determine
>> my current timezone.
>
> libc has a concept of timezone. I think, it should be the 
> primary
> source. It is initialized on application startup (roughly) from
> system-wide settings, may be overridden by TZ environment and 
> changed
> later by setting another value of TZ. The problem is that 
> identifier
> like "Australia/Sydney" is considered implementation specific 
> and is not
> directly accessible from the code, it is sealed inside the 
> library.
> Another issue is that I do not know if Emacs is able to receive
> notifications on change of system-wide timezone.
>
> Web-application may request time zone settings from the browser:
>      new Intl.DateTimeFormat().resolvedOptions().timeZone
>
> Android devices may have outdated and incomplete zoneinfo 
> database. This
> case either computations should be performed on the server or 
> tzdata
> copy should be bundled into the app.
>
> Client-server application may use resources maintained on 
> servers, emacs
> must be able to run off-line and enough user will be unhappy 
> noticed
> some outgoing queries.
>
> Ubuntu installer or e.g. Google relies on GeoIP databases.
>
> Geodata for timezones is available, but laptops or desktops 
> mostly do
> not have GPS receivers. IP behind NAT is not useful to determine 
> location.
>
> It is possible to make GeoIP database (quality of ones available 
> for
> free are not high) and map of timezones, but I do not think it 
> is
> reasonable.
>
> I suppose, system timezone would be enough for Org. Third party 
> packages
> might implement another way.

Thanks.  Much appreciated.  So, Org user will need to understand 
that timezone calculations will only be as current as libc and 
that user is responsible for setting local timezone.

All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-22 12:14                                                                         ` Max Nikulin
  2023-01-22 13:35                                                                           ` Thomas S. Dye
@ 2023-01-22 14:09                                                                           ` Max Nikulin
  1 sibling, 0 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-22 14:09 UTC (permalink / raw)
  To: emacs-orgmode

On 22/01/2023 19:14, Max Nikulin wrote:
> - ad-hoc timezone that follows user in their trips (close to Ramsey's 
> "occurrence").

Sorry, it should be "event", not "occurrence". It was not intentional 
demonstration of my confusion.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-22  8:35                                                                     ` Max Nikulin
@ 2023-01-22 16:54                                                                       ` Thomas S. Dye
  2023-01-23  6:28                                                                         ` Jean Louis
  0 siblings, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-22 16:54 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Aloha Max,

Max Nikulin <manikulin@gmail.com> writes:

> Thomas, notice that I resumed a postponed earlier part of 
> discussion related to
> timestamps in the past. Offset from UTC is almost always well 
> defined this case.
>
> My perception is that discussing timestamps in future, we came 
> to agreement with
> Tom that timestamps can be specified with timezone <2024-02-22
> 08:29@Australia/Sydney>, in UTC <2024-02-21
> 21:29@UTC>, or in local timezone <2024-02-22 08:29>
>
> Now I had a hope to convince at least some participants that 
> explicit time
> offset may be used interchangeably with UTC. It is applicable to 
> timestamps in
> the past and to future timestamps when the person who created 
> appointment
> respects remote participants, so decided to rule out DST and fix 
> absolute time.

Agreed, offset relative to UTC is absolute time.

>
> On 22/01/2023 13:17, Thomas S. Dye wrote:
>> UTC is not a timezone.  It is absolute time.
>
> I do not see any point to consider UTC too special.
>
It is independent of the legislative tampering (DST, etc.) that 
makes timezones difficult to work with.

> Both timestamps [2023-01-21 Sat 21:29@UTC] and [2023-01-22 Sun 
> 08:29@+1100]
> specify absolute time. "+1100" means 11 hours, not particular 
> location. Do you
> have an example of a case where I am wrong?

No, not if +1100 is relative to UTC.

> I use the term "time zone" as a set of rules how to calculate 
> offset at
> particular time moment. UTC is a degenerate case of fixed zero 
> offset. 
> In this sense "+11:00" is not a timezone, it is time offset. 
> Several time zones
> (as set of rules) may have such offset at some specific time 
> moments including
> "Etc/GMT-11" that is a timezone.
>
This confuses me.  Calculating offset relative to a timezone, such 
as HST, refers to space/time and yields an event.  Calculating 
offset relative to UTC does not refer to space/time and yields 
absolute time.  IMO, using "time zone", which typically refers to 
a region of space/time, to refer to a set of rules that might 
yield absolute time invites the confusion Ramsey was hoping to 
avoid.

>>> A side note. In my opinion, *by default* timestamps should be 
>>> created in
>>> local
>>> time with no offset or timezone. There are should be some 
>>> preferences to
>>> enable
>>> absolute timestamps and a function to fix offsets or timezone 
>>> identifiers for
>>> existing timestamp when the user realizes that they become 
>>> necessary (e.g.
>>> before a trip).
>> I don't think there should be a default.
>
> Unfortunately hard choice of default value or behavior is 
> unavoidable during
> development of software. Consider a user who just have installed 
> Org. Till it is
> explicitly configured, perhaps it is better to add e.g. clocking 
> entries without
> offset or timezone assuming local time. It should be possible to 
> change it
> later.
>
Is there some way for Org to identify when it is likely that user 
has not specified time zone?  If so, a query might be useful.

>>> So I do not see any advantages of UTC in comparison to time 
>>> offset specific
>>> to
>>> particular time zone, usually user's local one. My vote is 
>>> [2023-01-22 Sun
>>> 08:29@+1100] and not [2023-01-21 Sat 21:29@UTC] (of course, 
>>> only in cases
>>> when
>>> identifiers like Australia/Sydney do not matter) with a 
>>> configuration option
>>> with timezone used fix offsets in stored timestamps.
>> The disadvantage of time offset specific to a particular 
>> timezone is 
>> that the timezone offset wrt UTC can change arbitrarily. This 
>> is a potential
>> problem if the arbitrary change takes place between the 
>> creation of the
>> timestamp and the happening it identifies.  In contrast, UTC is 
>> guaranteed not
>> to change.  It is not a timezone, it is absolute time, a pure 
>> continuum.  It
>> is a requirement of occurrences.
>
> I consider the case when offset is already known because it is a 
> time moment in
> the past. Besides rare corner cases offset can be considered as 
> a part of
> authoritative data. Timestamps like [2023-01-22 Sun 08:29@+1100] 
> can be
> unambiguously mapped to UTC.
>
Yes, if +1100 is relative to UTC.  If not, then it assumes a 
timezone library that correctly includes the past time.

>> I'm not sure offset is necessary for events, given that offset 
>> can change
>> arbitrarily.  WDYT?  It seems to me that once an event has been 
>> tied to a
>> particular time in a particular time zone that Org's job is to 
>> take into
>> account changes to that timezone, such as DST and arbitrary 
>> legislation. 
>> These changes in the event's timezone need to be propagated 
>> through the
>> schedule for each user, so it is possible to synchronize local 
>> timestamps
>> around the globe.
>
> For timestamp in the past offsets simplifies calculation of 
> duration. Offsets
> may be used to fix absolute time before changing location when 
> time zone was
> omitted. Perhaps I will add more in another part of this thread.
>
> After all, for a person in Berlin [2023-01-22 Sun 08:29@+1100] 
> may tell more
> than [2023-01-22 Sun 08:29@Australia/Sydney].

I'm not sure to follow this.  IIUC, the timestamp with offset 
refers to absolute time, whereas the timestamp with the 
Australia/Sydney timezone refers to a region of space/time whose 
relation to absolute time is fixed for any moment, but potentially 
variable over time.

All the best,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-22 16:54                                                                       ` Thomas S. Dye
@ 2023-01-23  6:28                                                                         ` Jean Louis
  2023-01-23 16:04                                                                           ` Thomas S. Dye
  0 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-23  6:28 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Max Nikulin, emacs-orgmode

* Thomas S. Dye <tsd@tsdye.online> [2023-01-22 20:36]:
> > After all, for a person in Berlin [2023-01-22 Sun 08:29@+1100] may
> > tell more than [2023-01-22 Sun 08:29@Australia/Sydney].
> 
> I'm not sure to follow this.  IIUC, the timestamp with offset refers to
> absolute time, whereas the timestamp with the Australia/Sydney timezone
> refers to a region of space/time whose relation to absolute time is fixed
> for any moment, but potentially variable over time.

I understand above that it is easier understandable when reading
[2023-01-22 Sun 08:29@+1100] as it is assumed by poster (I guess Max)
that user will understand that there is +11 hours ahead.

That is assumption by poster. I do not find it easier.

As when user sees 08:29 that user will think of time in Berlin, of
time which is not in UTC, and not time in UTC plus 11 hours.

What is easier is what is generally accepted in any type of software
worldwide, just represent it in local time zone.

Difference between offset time and time with time zone is that time
zone includes rules of daylight savings and other anomalies.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-23  6:28                                                                         ` Jean Louis
@ 2023-01-23 16:04                                                                           ` Thomas S. Dye
  2023-01-24  2:34                                                                             ` Max Nikulin
                                                                                               ` (2 more replies)
  0 siblings, 3 replies; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-23 16:04 UTC (permalink / raw)
  To: Jean Louis; +Cc: Thomas S. Dye, Max Nikulin, emacs-orgmode

Aloha Jean Louis,
Jean Louis <bugs@gnu.support> writes:

> * Thomas S. Dye <tsd@tsdye.online> [2023-01-22 20:36]:
>> > After all, for a person in Berlin [2023-01-22 Sun 
>> > 08:29@+1100] may
>> > tell more than [2023-01-22 Sun 08:29@Australia/Sydney].
>> 
>> I'm not sure to follow this.  IIUC, the timestamp with offset 
>> refers to
>> absolute time, whereas the timestamp with the Australia/Sydney 
>> timezone
>> refers to a region of space/time whose relation to absolute 
>> time is fixed
>> for any moment, but potentially variable over time.
>
> I understand above that it is easier understandable when reading
> [2023-01-22 Sun 08:29@+1100] as it is assumed by poster (I guess 
> Max)
> that user will understand that there is +11 hours ahead.
>
Yes, the offset here is ambiguous--is it offset from some timezone 
or from UTC?

> That is assumption by poster. I do not find it easier.
>
> As when user sees 08:29 that user will think of time in Berlin, 
> of
> time which is not in UTC, and not time in UTC plus 11 hours.
>
> What is easier is what is generally accepted in any type of 
> software
> worldwide, just represent it in local time zone.
>
> Difference between offset time and time with time zone is that 
> time
> zone includes rules of daylight savings and other anomalies.

Right.  The difficulty with scheduling is that it has to take into 
account two time zones in some cases.

Here is a proposal for a terminology of events that honors 
Ramsey's distinction between events and occurrences and hopes to 
cover all of Org's use cases.

* Kinds of event
 - No-host event :: An event that takes place at an absolute time. 
 Participants must know their local timezone offset from UTC. 
 Example [2023-01-23 06:00@UTC].
 - Situated event :: An event that takes place at a time local to 
 the event site.  Participants must know their local timezone 
 offset from UTC and the event site timezone offset from UTC at 
 the time of the event.  Example [2023-01-22 Sun 
 08:29@Australia/Sydney].
 - [Itinerant | Traveling | Mobile] event :: An event that takes 
 place at a time local to the event site, which might change after 
 the event has been scheduled.  Participants must know their local 
 timezone offset from UTC and the event site timezone offset from 
 UTC at the time of the event.  Examples might be a regular staff 
 meeting that takes place at 9:00 AM wherever the boss happens to 
 be, or a proposal to meet with a traveler when it is noon on 
 Sunday for the traveler. Example [2023-01-23 06:00].  In this 
 case timezone is set according to user timezone preference in 
 scope.

The Org user should be able to toggle timestamp representation. 
In the case of a no-host event, user might toggle between UTC and 
local time.  In the case of situated or itinerant event, user 
might toggle among UTC, local time, and local time at the event 
site.

WDYT?

All the best,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-23 16:04                                                                           ` Thomas S. Dye
@ 2023-01-24  2:34                                                                             ` Max Nikulin
  2023-01-24  2:44                                                                               ` Thomas S. Dye
  2023-01-24  9:34                                                                             ` Ihor Radchenko
  2023-01-26 15:37                                                                             ` Max Nikulin
  2 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-24  2:34 UTC (permalink / raw)
  To: emacs-orgmode

On 23/01/2023 23:04, Thomas S. Dye wrote:
>> I understand above that it is easier understandable when reading
>> [2023-01-22 Sun 08:29@+1100] as it is assumed by poster (I guess Max)
>> that user will understand that there is +11 hours ahead.
>>
> Yes, the offset here is ambiguous--is it offset from some timezone or 
> from UTC?

Are you aware of usage base time other than UTC nowadays? My impression 
is that various libraries do not allow to get such formats easily. That 
is why e.g. web sites tends to present time in the server timezone 
(often not explicitly specified) or use JavaScript to convert it to 
browser timezone.

I believed that [2023-01-22 Sun 08:29@+1100] unambiguously suggests 
offset from UTC.

Are there local references that may confuse users? I mean something like 
9 hours ahead of Moscow (Asia/Kamchatka) used in USSR.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-24  2:34                                                                             ` Max Nikulin
@ 2023-01-24  2:44                                                                               ` Thomas S. Dye
  2023-01-24  4:48                                                                                 ` Max Nikulin
  0 siblings, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-24  2:44 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Aloha Max,

Max Nikulin <manikulin@gmail.com> writes:

> On 23/01/2023 23:04, Thomas S. Dye wrote:
>>> I understand above that it is easier understandable when 
>>> reading
>>> [2023-01-22 Sun 08:29@+1100] as it is assumed by poster (I 
>>> guess Max)
>>> that user will understand that there is +11 hours ahead.
>>>
>> Yes, the offset here is ambiguous--is it offset from some 
>> timezone or from
>> UTC?
>
> Are you aware of usage base time other than UTC nowadays? My 
> impression is that
> various libraries do not allow to get such formats easily. That 
> is why e.g. web
> sites tends to present time in the server timezone (often not 
> explicitly
> specified) or use JavaScript to convert it to browser timezone.
>
> I believed that [2023-01-22 Sun 08:29@+1100] unambiguously 
> suggests offset from
> UTC.

Not for a casual programmer like me. The timestamp alone might 
easily be read as 11 hours ahead of local time. Nevertheless, Org 
is certainly free to interpret it as relative to UTC.

> Are there local references that may confuse users? I mean 
> something like 9 hours
> ahead of Moscow (Asia/Kamchatka) used in USSR.

I think 9 hours ahead of a timezone with a potentially variable 
offset from UTC has the potential to sow confusion, yes.

All the best,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-24  2:44                                                                               ` Thomas S. Dye
@ 2023-01-24  4:48                                                                                 ` Max Nikulin
  2023-01-24 19:18                                                                                   ` Jean Louis
  0 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-24  4:48 UTC (permalink / raw)
  To: emacs-orgmode

On 24/01/2023 09:44, Thomas S. Dye wrote:
> Max Nikulin writes:
>>
>> I believed that [2023-01-22 Sun 08:29@+1100] unambiguously suggests 
>> offset from UTC.
> 
> Not for a casual programmer like me. The timestamp alone might easily be 
> read as 11 hours ahead of local time. Nevertheless, Org is certainly 
> free to interpret it as relative to UTC.

My primary concern is that I might be wrong assuming that format like 
[2023-01-22 Sun 08:29@+1100] with offset in respect to UTC is reciprocal 
identity  mapping to UTC.

Of course there are a lot of people unaware of UTC. Org users may be 
educated by the manual and by hints in UI pushing toward time fixed in 
respect to UTC when "global" timestamp should be added. (In the sense of 
e.g. Lunar eclipse or an on-line meeting, not to confuse with set of 
events appointed on specific date but starting at the same local time in 
each location).

I am afraid of confusion with repeater intervals, but syntax has not 
fixed yet.

So we had different types of ambiguity in mind. Base time for offset was 
unclear for you, I was writing about mapping to UTC. Your point should 
be taken into account during consideration of storage format.

I still believe that something like [2023-01-21 Sat 21:29:00Z] and 
[2023-01-22 Sun 08:29@+1100] may be used to store timestamps 
interchangeably.

>> Are there local references that may confuse users? I mean something 
>> like 9 hours
>> ahead of Moscow (Asia/Kamchatka) used in USSR.
> 
> I think 9 hours ahead of a timezone with a potentially variable offset 
> from UTC has the potential to sow confusion, yes.

If someone has examples of local time offsets (unrelated to UTC) widely 
used in some area, please, post them.

MSK+3 style was not a real issue because daylight saving time was active 
during the same period in the whole country and iron curtain was 
efficiently isolating most of people form variety of DST rules in other 
areas.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-23 16:04                                                                           ` Thomas S. Dye
  2023-01-24  2:34                                                                             ` Max Nikulin
@ 2023-01-24  9:34                                                                             ` Ihor Radchenko
  2023-01-24 16:41                                                                               ` Thomas S. Dye
  2023-01-26 15:37                                                                             ` Max Nikulin
  2 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-24  9:34 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Jean Louis, Max Nikulin, emacs-orgmode

"Thomas S. Dye" <tsd@tsdye.online> writes:

>> I understand above that it is easier understandable when reading
>> [2023-01-22 Sun 08:29@+1100] as it is assumed by poster (I guess 
>> Max)
>> that user will understand that there is +11 hours ahead.
>>
> Yes, the offset here is ambiguous--is it offset from some timezone 
> or from UTC?

It is not ambiguous if the user is familiar with standard time format.
The representation above is derived from
https://en.wikipedia.org/wiki/ISO_8601, which allows the following:

    <time>Z

    If the time is in UTC, add a Z directly after the time without a space.
    Z is the zone designator for the zero UTC offset. "09:30 UTC" is
    therefore represented as "09:30Z" or "T0930Z". "14:45:15 UTC" would be
    "14:45:15Z" or "T144515Z".

    <time>±hh:mm
    <time>±hhmm
    <time>±hh

    The UTC offset is appended to the time in the same way that 'Z' was
    above, in the form ±[hh]:[mm], ±[hh][mm], or ±[hh].

    Negative UTC offsets describe a time zone west of UTC±00:00, where the
    civil time is behind (or earlier) than UTC so the zone designator will
    look like "−03:00","−0300", or "−03".
    
    Positive UTC offsets describe a time zone at or east of UTC±00:00, where
    the civil time is the same as or ahead (or later) than UTC so the zone
    designator will look like "+02:00","+0200", or "+02".

> Here is a proposal for a terminology of events that honors 
> Ramsey's distinction between events and occurrences and hopes to 
> cover all of Org's use cases.
> ...
> ...
> The Org user should be able to toggle timestamp representation. 
> In the case of a no-host event, user might toggle between UTC and 
> local time.  In the case of situated or itinerant event, user 
> might toggle among UTC, local time, and local time at the event 
> site.

Instead of toggling, would it be better to echo the different formats
like eldoc does + mouse-echo?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-24  9:34                                                                             ` Ihor Radchenko
@ 2023-01-24 16:41                                                                               ` Thomas S. Dye
  0 siblings, 0 replies; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-24 16:41 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Thomas S. Dye, Jean Louis, Max Nikulin, emacs-orgmode

Aloha Ihor,

Ihor Radchenko <yantar92@posteo.net> writes:

> "Thomas S. Dye" <tsd@tsdye.online> writes:
>
>>> I understand above that it is easier understandable when 
>>> reading
>>> [2023-01-22 Sun 08:29@+1100] as it is assumed by poster (I 
>>> guess 
>>> Max)
>>> that user will understand that there is +11 hours ahead.
>>>
>> Yes, the offset here is ambiguous--is it offset from some 
>> timezone 
>> or from UTC?
>
> It is not ambiguous if the user is familiar with standard time 
> format.
> The representation above is derived from
> https://en.wikipedia.org/wiki/ISO_8601, which allows the 
> following:
>
>     <time>Z
>
>     If the time is in UTC, add a Z directly after the time 
>     without a space.
>     Z is the zone designator for the zero UTC offset. "09:30 
>     UTC" is
>     therefore represented as "09:30Z" or "T0930Z". "14:45:15 
>     UTC" would be
>     "14:45:15Z" or "T144515Z".
>
>     <time>±hh:mm
>     <time>±hhmm
>     <time>±hh
>
>     The UTC offset is appended to the time in the same way that 
>     'Z' was
>     above, in the form ±[hh]:[mm], ±[hh][mm], or ±[hh].
>
>     Negative UTC offsets describe a time zone west of UTC±00:00, 
>     where the
>     civil time is behind (or earlier) than UTC so the zone 
>     designator will
>     look like "−03:00","−0300", or "−03".
>     
>     Positive UTC offsets describe a time zone at or east of 
>     UTC±00:00, where
>     the civil time is the same as or ahead (or later) than UTC 
>     so the zone
>     designator will look like "+02:00","+0200", or "+02".
>

Got it.  Thanks for the full explanation!  The ambiguity I 
mentioned was due to my ignorance of the time standard format 
variants.

>> Here is a proposal for a terminology of events that honors 
>> Ramsey's distinction between events and occurrences and hopes 
>> to 
>> cover all of Org's use cases.
>> ...
>> ...
>> The Org user should be able to toggle timestamp representation. 
>> In the case of a no-host event, user might toggle between UTC 
>> and 
>> local time.  In the case of situated or itinerant event, user 
>> might toggle among UTC, local time, and local time at the event 
>> site.
>
> Instead of toggling, would it be better to echo the different 
> formats
> like eldoc does + mouse-echo?

Or both?  Toggling globally and echoing individually, IIUC?

All the best,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-22  7:48                                                                   ` Tim Cross
@ 2023-01-24 17:09                                                                     ` Max Nikulin
  2023-01-24 19:20                                                                       ` Jean Louis
  2023-01-24 20:50                                                                       ` Tim Cross
  0 siblings, 2 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-24 17:09 UTC (permalink / raw)
  To: emacs-orgmode

On 22/01/2023 14:48, Tim Cross wrote:
> Timestamp for a log
> record I would probably want <YYYY-MM-DD HH:MM Z> or one of the
> variants because the most common way I use those types of timestamp is
> in diagnosing problems and comparing revords from various locations
> where I don't care about the local time where the record was generated,
> but with when it occurred in relation to other log recores.

I agree that it is more convenient to have uniform offset in such case, 
especially in the case of multiple files having their specific timezone. 
During trips I do not expect so much changes of timezone to make 
comparison of timestamps significantly harder.

> I would argue that all depends on how you use the information. My org
> files are consumed by me (reading) and by scripts, elisp and other
> programs.

For scripts given offset should not be an issue at all. And it is up to 
you if you prefer to have UTC instead of local time offset in you files.

> My preference is for a timestamp syntax which lets the user select the
> format they want and not attempt to restrict it more than that.

I do not mind to provide a user option for preferred storage format used 
for clock entries and similar stuff.

> Provided
> you can specify timestamp with and without TZ information and you
> support full and abbreviated time zone names as well as UTC, I don't
> think it mattters - let the user choose what suits them best.

Concerning time zone abbreviations, I would discourage them as much as 
possible for storage format. They may be added to overlay though. 
Perhaps US residents would be unhappy by such decision, but there are 
enough examples of the same abbreviation for completely unrelated 
locations. Abbreviation may be useful in addition to timezone ID to 
disambiguate local time close to a backward time jump.

Tim, in your last messages I do not see statements causing my objections 
any more. It seems we came to agreement: flexible enough storage format 
and configurable display format for overlays. Have I forgot anything?



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-24  4:48                                                                                 ` Max Nikulin
@ 2023-01-24 19:18                                                                                   ` Jean Louis
  0 siblings, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-24 19:18 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

* Max Nikulin <manikulin@gmail.com> [2023-01-24 07:51]:
> On 24/01/2023 09:44, Thomas S. Dye wrote:
> > Max Nikulin writes:
> > > 
> > > I believed that [2023-01-22 Sun 08:29@+1100] unambiguously suggests
> > > offset from UTC.
> > 
> > Not for a casual programmer like me. The timestamp alone might easily be
> > read as 11 hours ahead of local time. Nevertheless, Org is certainly
> > free to interpret it as relative to UTC.
> 
> My primary concern is that I might be wrong assuming that format like
> [2023-01-22 Sun 08:29@+1100] with offset in respect to UTC is reciprocal
> identity  mapping to UTC.

ISO 8601 is international standard on which you should make decisions.

https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC
https://en.wikipedia.org/wiki/UTC_offset

,----
| The UTC offset (or time offset) is an amount of time subtracted from
| or added to Coordinated Universal Time (UTC) time to specify the local
| solar time (which may not be the current civil time, whether it is
| standard time or daylight saving time). 
`----

I hope your concern clarifies itself.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-24 17:09                                                                     ` Max Nikulin
@ 2023-01-24 19:20                                                                       ` Jean Louis
  2023-01-24 20:50                                                                       ` Tim Cross
  1 sibling, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-24 19:20 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

* Max Nikulin <manikulin@gmail.com> [2023-01-24 20:12]:
> On 22/01/2023 14:48, Tim Cross wrote:
> > Timestamp for a log
> > record I would probably want <YYYY-MM-DD HH:MM Z> or one of the
> > variants because the most common way I use those types of timestamp is
> > in diagnosing problems and comparing revords from various locations
> > where I don't care about the local time where the record was generated,
> > but with when it occurred in relation to other log recores.
> 
> I agree that it is more convenient to have uniform offset in such case,
> especially in the case of multiple files having their specific timezone.
> During trips I do not expect so much changes of timezone to make comparison
> of timestamps significantly harder.
> 
> > I would argue that all depends on how you use the information. My org
> > files are consumed by me (reading) and by scripts, elisp and other
> > programs.
> 
> For scripts given offset should not be an issue at all. And it is up to you
> if you prefer to have UTC instead of local time offset in you files.

Surely I understand your point of view, but offset does not provide to
people their local time, that would just make confusion.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-24 17:09                                                                     ` Max Nikulin
  2023-01-24 19:20                                                                       ` Jean Louis
@ 2023-01-24 20:50                                                                       ` Tim Cross
  1 sibling, 0 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-24 20:50 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> On 22/01/2023 14:48, Tim Cross wrote:
>> Timestamp for a log
>> record I would probably want <YYYY-MM-DD HH:MM Z> or one of the
>> variants because the most common way I use those types of timestamp is
>> in diagnosing problems and comparing revords from various locations
>> where I don't care about the local time where the record was generated,
>> but with when it occurred in relation to other log recores.
>
> I agree that it is more convenient to have uniform offset in such case, especially in the
> case of multiple files having their specific timezone. During trips I do not expect so
> much changes of timezone to make comparison of timestamps significantly harder.
>
>> I would argue that all depends on how you use the information. My org
>> files are consumed by me (reading) and by scripts, elisp and other
>> programs.
>
> For scripts given offset should not be an issue at all. And it is up to you if you prefer
> to have UTC instead of local time offset in you files.
>
>> My preference is for a timestamp syntax which lets the user select the
>> format they want and not attempt to restrict it more than that.
>
> I do not mind to provide a user option for preferred storage format used for clock entries
> and similar stuff.
>
>> Provided
>> you can specify timestamp with and without TZ information and you
>> support full and abbreviated time zone names as well as UTC, I don't
>> think it mattters - let the user choose what suits them best.
>
> Concerning time zone abbreviations, I would discourage them as much as possible for
> storage format. They may be added to overlay though. Perhaps US residents would be unhappy
> by such decision, but there are enough examples of the same abbreviation for completely
> unrelated locations. Abbreviation may be useful in addition to timezone ID to disambiguate
> local time close to a backward time jump.
>
> Tim, in your last messages I do not see statements causing my objections any more. It
> seems we came to agreement: flexible enough storage format and configurable display format
> for overlays. Have I forgot anything?

No, I think you have covered everything.

I think most of your remaining concerns can be adequately covered via
some updated documentation and with some luck, people will add some use
case workflows to worg showing how using different storage formats and
display overlays can address various scenarios.  


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Org mode timestamps on the Moon ;] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)
  2023-01-14  5:51   ` Tom Gillespie
  2023-01-14  6:40     ` tomas
@ 2023-01-26 15:24     ` Ihor Radchenko
  2023-01-26 16:08       ` Org mode timestamps on the Moon ;] Fraga, Eric
  2023-01-26 23:40       ` Org mode timestamps on the Moon ;] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Tom Gillespie
  1 sibling, 2 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-26 15:24 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: Org-mode, Carsten Dominik

Tom Gillespie <tgbugs@gmail.com> writes:

> ; given my objective to ensure that org documents can be interpreted
> ; without having to stick stupid things like #+planet: mars in the
> ; header or risk your earthling readers getting incorrect dates --- I
> ; suggest that org switch to storing all dates and times in earth zulu
> ; time ...

https://www.nature.com/articles/d41586-023-00185-z

"The coming decade will see a resurgence in lunar exploration —
including dozens of missions and plans to establish permanent bases on
the Moon. The endeavours pose myriad challenges. Among them is a subtle,
but fundamental, question that metrologists worldwide are working to
answer: what time is it on the Moon?"

...

"It’s not obvious what form a universal lunar time would take. Clocks on
Earth and the Moon naturally tick at different speeds, because of the
differing gravitational fields of the two bodies"

...

"Decisions must be made soon,... If an official lunar time is not
established, space agencies and private companies will come up with
their own solutions" (and Org too?)

...

"Moon missions will also need an official lunar time to cooperate and
communicate, says Hahn. “All this has to trace to one kind of a time
reference, otherwise you have chaos and things do not work together.”"

...

"The Moon’s gravitational pull is weaker than Earth’s, meaning that, to
an observer on Earth, a lunar clock would run faster than an Earth one.
Gramling estimates that a lunar clock would gain about 56 microseconds
over 24 hours" (how will it affect Org's timestamps? should we do
anything about it?)

"...a clock’s speed would also subtly change depending on its position
on the lunar surface, because of the Moon’s rotation" (oh, dear...)

...

“The idea is to produce a Solar System internet,” says Gramling. “And
the first part would be at the Moon.” 

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-23 16:04                                                                           ` Thomas S. Dye
  2023-01-24  2:34                                                                             ` Max Nikulin
  2023-01-24  9:34                                                                             ` Ihor Radchenko
@ 2023-01-26 15:37                                                                             ` Max Nikulin
  2023-01-26 16:31                                                                               ` Thomas S. Dye
  2 siblings, 1 reply; 330+ messages in thread
From: Max Nikulin @ 2023-01-26 15:37 UTC (permalink / raw)
  To: emacs-orgmode

On 23/01/2023 23:04, Thomas S. Dye wrote:
> * Kinds of event
> - No-host event :: An event that takes place at an absolute time. 
> Participants must know their local timezone offset from UTC. Example 
> [2023-01-23 06:00@UTC].
> - Situated event :: An event that takes place at a time local to the 
> event site.  Participants must know their local timezone offset from UTC 
> and the event site timezone offset from UTC at the time of the event.  
> Example [2023-01-22 Sun 08:29@Australia/Sydney].
> - [Itinerant | Traveling | Mobile] event :: An event that takes place at 
> a time local to the event site, which might change after the event has 
> been scheduled.  Participants must know their local timezone offset from 
> UTC and the event site timezone offset from UTC at the time of the 
> event.  Examples might be a regular staff meeting that takes place at 
> 9:00 AM wherever the boss happens to be, or a proposal to meet with a 
> traveler when it is noon on Sunday for the traveler. Example [2023-01-23 
> 06:00].  In this case timezone is set according to user timezone 
> preference in scope.

Thomas, I mostly agree with the set of event kinds your suggested. 
Perhaps names should be justified to have precise and concise terms in 
UI. From my point of view their value is association with appropriate 
storage format for particular timestamp.

An additional parameter (or sometimes first one to choose) is if 
explicit or implicit time zone should be used in the file. In the latter 
case the same kinds of events are possible, particular one is determined 
from a parent scope. User should be just aware what is actual time zone 
if it is implicit one.

The following concept is aside from event kinds, but might (or might 
not) be useful to present agenda, to schedule events, to implement the 
feature. Perhaps a trip may be considered as an ad hoc timezone that 
follows offsets of time in locations to visit. (Several such ad hoc time 
zones may allow to track schedule of several people, but it may be too 
complex to use.) It may be considered close to "mobile" event, but the 
purpose is not to ensure correct time of particular event. It may 
facilitate presentation of timeline during the trip.

Perhaps it is more correct to talk about how events are scheduled, not 
of event kinds. Consider Christmas and similar events. It is personal 
and local for each user. If you share your .org file (with specified 
file-local time zone) with other persons they celebrate accordingly to 
their local time. In addition they may decide that it should be pleasant 
for you to receive a greeting close to your local time.

It seems during discussion we use terms in slightly different meaning, 
so I will try to clarify my point of view.

I had a course on general relativity theory, so "absolute time" does 
make much sense for me. UTC is just a widely accepted agreement. I was 
bound to Earth rotation and accumulated some offset from more precise 
atomic clocks. UTC however currently is easiest way to perform time 
related calculations.

My perception is still that UTC is one of timezones that may be used to 
specify event time. It is a bit special since it is used as a reference 
for other time zones, so it may be preferable for global events. If UTC 
considered as an ordinary time zone then the whole set of time zones may 
be divided into 2 classes: with fixed time offset (including UTC, 
Etc/GMT+3 that may be specified as -03:00, etc) and with time zones 
associated to specific locations. Second class is affected by DST, 
changes of offsets that may be source of uncertainty. The role of UI is 
to help user to choose a timezone that is suited best for particular 
event. For events in the future often it is necessary to use a 
location-based time zone, in other cases it is UTC or anyone with fixed 
offset. When you recording current time, explicit offset may be better. 
I am still unsure what is better to use: kinds of events or kinds of 
time zones.

I agree that offset as a part of timestamp may be confusing, but I am 
afraid that significant part of affected users are unaware of UTC as 
well. That is why proper UI may be a challenging task.

Thomas, for me event kinds are less important than understanding that 
UTC timestamps are not enough achieve properly working schedule. 
Currently you see that timezones associated with locations in some cases 
must be used in stored timestamps. Have you noticed that I missed 
anything significant in your messages?



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: Org mode timestamps on the Moon ;]
  2023-01-26 15:24     ` Org mode timestamps on the Moon ;] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Ihor Radchenko
@ 2023-01-26 16:08       ` Fraga, Eric
  2023-01-26 16:28         ` Thomas S. Dye
  2023-01-26 23:40       ` Org mode timestamps on the Moon ;] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Tom Gillespie
  1 sibling, 1 reply; 330+ messages in thread
From: Fraga, Eric @ 2023-01-26 16:08 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Tom Gillespie, Org-mode, Carsten Dominik

On Thursday, 26 Jan 2023 at 15:24, Ihor Radchenko wrote:
> "The Moon’s gravitational pull is weaker than Earth’s, meaning that, to
> an observer on Earth, a lunar clock would run faster than an Earth one.
> Gramling estimates that a lunar clock would gain about 56 microseconds
> over 24 hours" (how will it affect Org's timestamps? should we do
> anything about it?)

Well, it would take a little over 120 years for this difference to affect an org time stamp (given resolution to the minute as used by org)...

I love what I'm learning about time zones etc. in this discussion thread!

-- 
: Eric S Fraga, with org release_9.6.1-199-g7ad779 in Emacs 30.0.50

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: Org mode timestamps on the Moon ;]
  2023-01-26 16:08       ` Org mode timestamps on the Moon ;] Fraga, Eric
@ 2023-01-26 16:28         ` Thomas S. Dye
  0 siblings, 0 replies; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-26 16:28 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Ihor Radchenko, Tom Gillespie, Carsten Dominik, emacs-orgmode

Aloha Eric,

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> On Thursday, 26 Jan 2023 at 15:24, Ihor Radchenko wrote:
>> "The Moon’s gravitational pull is weaker than Earth’s, meaning 
>> that, to
>> an observer on Earth, a lunar clock would run faster than an 
>> Earth one.
>> Gramling estimates that a lunar clock would gain about 56 
>> microseconds
>> over 24 hours" (how will it affect Org's timestamps? should we 
>> do
>> anything about it?)
>
> Well, it would take a little over 120 years for this difference 
> to affect an org time stamp (given resolution to the minute as 
> used by org)...
>
> I love what I'm learning about time zones etc. in this 
> discussion thread!

Then I can recommend Carlo Rovelli's The Order of Time.

All the best,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-26 15:37                                                                             ` Max Nikulin
@ 2023-01-26 16:31                                                                               ` Thomas S. Dye
  2023-01-27 21:21                                                                                 ` Tim Cross
  0 siblings, 1 reply; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-26 16:31 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Aloha Max,

Max Nikulin <manikulin@gmail.com> writes:

> On 23/01/2023 23:04, Thomas S. Dye wrote:
>> * Kinds of event
>> - No-host event :: An event that takes place at an absolute 
>> time. Participants
>> must know their local timezone offset from UTC. Example 
>> [2023-01-23
>> 06:00@UTC].
>> - Situated event :: An event that takes place at a time local 
>> to the event
>> site.  Participants must know their local timezone offset from 
>> UTC and the
>> event site timezone offset from UTC at the time of the event. 
>> Example
>> [2023-01-22 Sun 08:29@Australia/Sydney].
>> - [Itinerant | Traveling | Mobile] event :: An event that takes 
>> place at a
>> time local to the event site, which might change after the 
>> event has been
>> scheduled.  Participants must know their local timezone offset 
>> from UTC and
>> the event site timezone offset from UTC at the time of the 
>> event.  Examples
>> might be a regular staff meeting that takes place at 9:00 AM 
>> wherever the boss
>> happens to be, or a proposal to meet with a traveler when it is 
>> noon on Sunday
>> for the traveler. Example [2023-01-23 06:00].  In this case 
>> timezone is set
>> according to user timezone preference in scope.
>
> Thomas, I mostly agree with the set of event kinds your 
> suggested. Perhaps names
> should be justified to have precise and concise terms in UI. 
> From my point of
> view their value is association with appropriate storage format 
> for particular
> timestamp.
>
Agreed.  Another idea for the mobile event is "variably situated 
event".  I don't doubt that better terms might be proposed.

> An additional parameter (or sometimes first one to choose) is if 
> explicit or
> implicit time zone should be used in the file. In the latter 
> case the same kinds
> of events are possible, particular one is determined from a 
> parent scope. User
> should be just aware what is actual time zone if it is implicit 
> one.

I was trying to capture this in the timestamp, where an explicit 
time zone is indicated and an implicit time zone is simply a date 
and time.
>
> The following concept is aside from event kinds, but might (or 
> might not) be
> useful to present agenda, to schedule events, to implement the 
> feature. Perhaps
> a trip may be considered as an ad hoc timezone that follows 
> offsets of time in
> locations to visit. (Several such ad hoc time zones may allow to 
> track schedule
> of several people, but it may be too complex to use.) It may be 
> considered close
> to "mobile" event, but the purpose is not to ensure correct time 
> of particular
> event. It may facilitate presentation of timeline during the 
> trip.

An alternative would be to have headlines for each stop on the 
trip, each of which has a #+TIMEZONE property.  Under each 
headline would be subheads for events, each with a timestamp for a 
"mobile event".  Org would let me toggle the times of these events 
relative to my current location, the event location, and UTC.

>
> Perhaps it is more correct to talk about how events are 
> scheduled, not of event
> kinds. Consider Christmas and similar events. It is personal and 
> local for each
> user. If you share your .org file (with specified file-local 
> time zone) with
> other persons they celebrate accordingly to their local time. In 
> addition they
> may decide that it should be pleasant for you to receive a 
> greeting close to
> your local time.

In the first case, "Open Christmas presents at 8:00 AM", the event 
would be variably situated because I want to do this on the years 
I celebrate at home and also the years when I celebrate with 
friends and family in other parts of the world.  A timestamp for a 
variably situated event shares well--the recipient user needs to 
ensure that the event is stored within user's local time zone 
scope.

In the second case, "Send Christmas greetings to Max when he opens 
presents at 8:00 AM" would be an event situated at the place Max 
is celebrating--it is separate from the first case.  If I know 
where Max will celebrate Christmas, then I could use a timestamp 
for a situated event.  Otherwise, I would use a timestamp for a 
mobile event and make certain to ensure that the time zone scope 
for the event tracks Max's whereabouts.
>
> It seems during discussion we use terms in slightly different 
> meaning, so I will
> try to clarify my point of view.
>
> I had a course on general relativity theory, so "absolute time" 
> does make much
> sense for me. UTC is just a widely accepted agreement. I was 
> bound to Earth
> rotation and accumulated some offset from more precise atomic 
> clocks. UTC
> however currently is easiest way to perform time related 
> calculations.

Yes, UTC is the sign we've widely agreed to interpret as absolute 
time.  A key property is that UTC is a continuum, absent the 
potential discontinuities that characterize space/time units like 
time zones.

> My perception is still that UTC is one of timezones that may be 
> used to specify
> event time. It is a bit special since it is used as a reference 
> for other time
> zones, so it may be preferable for global events. If UTC 
> considered as an
> ordinary time zone then the whole set of time zones may be 
> divided into 2
> classes: with fixed time offset (including UTC, Etc/GMT+3 that 
> may be specified
> as -03:00, etc) and with time zones associated to specific 
> locations. Second
> class is affected by DST, changes of offsets that may be source 
> of uncertainty.
> The role of UI is to help user to choose a timezone that is 
> suited best for
> particular event. For events in the future often it is necessary 
> to use a 
> location-based time zone, in other cases it is UTC or anyone 
> with fixed offset.
> When you recording current time, explicit offset may be better. 
> I am still
> unsure what is better to use: kinds of events or kinds of time 
> zones.
>
Well, you know where I stand on this---UTC is not a time zone and 
no good comes from confusing it with one.  Nevertheless, the UI 
issue need not require the user to grasp the distinction between 
event and occurrence.  My idea was to use "no host event" to refer 
to an occurrence.  To my mind, "no host" gets to the point of "not 
associated with a particular region of space/time", so that 
calling it an event, a fundamental space/time unit, is less likely 
to cause confusion.

> I agree that offset as a part of timestamp may be confusing, but 
> I am afraid
> that significant part of affected users are unaware of UTC as 
> well. That is why
> proper UI may be a challenging task.
>
The discussion around this point confuses me.  One the one hand, a 
timestamp for absolute time (UTC or offset from UTC) should be 
stored in the format that minimizes computations that will 
subsequently involve it.  On the other hand, the user can toggle 
or otherwise see (Ihor's eldoc solution) the timestamp in the 
format that makes the most sense, so the readability of the 
storage format is not really at issue.

> Thomas, for me event kinds are less important than understanding 
> that UTC
> timestamps are not enough achieve properly working schedule. 
> Currently you see
> that timezones associated with locations in some cases must be 
> used in stored
> timestamps. Have you noticed that I missed anything significant 
> in your
> messages?

No, I don't think you've missed anything significant.  Thanks very 
much for your patience during a discussion that was interesting 
for me.  I learned quite a bit from you and the other contributors 
to the thread and look forward now to learning how Org mode 
evolves to handle events and occurrences.

Let me know if you have questions.

All the best,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: Org mode timestamps on the Moon ;] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)
  2023-01-26 15:24     ` Org mode timestamps on the Moon ;] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Ihor Radchenko
  2023-01-26 16:08       ` Org mode timestamps on the Moon ;] Fraga, Eric
@ 2023-01-26 23:40       ` Tom Gillespie
  2023-01-30 10:13         ` Org mode timestamps on the Moon ; ] " Greg Minshall
  2023-01-30 13:05         ` Org mode timestamps on the Moon ;] " Ihor Radchenko
  1 sibling, 2 replies; 330+ messages in thread
From: Tom Gillespie @ 2023-01-26 23:40 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org-mode, Carsten Dominik

Oh boy. In short, I think we can only hope they come up with
LTC and we already have a syntactic space to say whether
our reference seconds are TAI/UTC/LTC/MTC/JTC etc. And
being the privileged squats that we are if the time system is
left out then it means UTC. The friendly thing to do would be
to always include the time system code in our timestamps,
but I don't think those have standard reference codes yet?

> would gain about 56 microseconds over 24 hours

And here I was naively hoping to avoid having to deal with
relativistic effects. That would seem to be a pretty serious
issue, but my assumption further down that comment is
hopefully what they will do. Specifically:

> let's just assume that clock synchonization will happen between earth and
> mars so that the unix epoch could be synchronized between the frames

The only generalized solution is to record the full location
(see intro to http://naggum.no/lugm-time.html which I'm surprised
hasn't been linked in this thread yet, but was linked on the same
topic back in 2011 it seems) and let people sort out how to translate
that local time from that reference frame in that particular gravity well.

I don't think we want to force users to start embedding their gps
coordinates, their current acceleration, etc. along with their
timestamp. But it turns out that the unix epoch is only standard
at 9.8m/s^2. So ... minutes should be ok right?

Joking aside. Clocks run faster on the moon, slower on the ISS,
so either clocks are synchronized back to earth seconds, or
they use some alternate standard reference time.

My expectation is that there will be some time keeping standard
that will ensure uniformity and that what we will want to capture
is whose seconds they are using to keep track of time, because
unix epoch on the moon has a different integer value than on
earth, and is likely off by multiple seconds.

I guess as long as the moon can participate in earth NTP it will
be ok? Otherwise I suspect that the NTP network standard for
the celestial body will be what we want to go with/record. I think
that will fit in the opening you have created for this in the syntax.

So instead of UTC it would be LTC (lunar coordinated time).
If you're getting logs from servers on the moon knowing that the
system clock was running on LTC and not UTC will be critical.

Some future engineer: "Leaving earth was a mistake."


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-20  6:14                                                           ` Thomas S. Dye
@ 2023-01-27  6:06                                                             ` Sterling Hooten
  2023-01-27  6:09                                                               ` Daryl Manning
                                                                                 ` (3 more replies)
  0 siblings, 4 replies; 330+ messages in thread
From: Sterling Hooten @ 2023-01-27  6:06 UTC (permalink / raw)
  To: Thomas S. Dye
  Cc: Tim Cross, Jean Louis, Ihor Radchenko, Daryl Manning, rjhorn,
	emacs-orgmode

Hi all,

Collaborating around the subject of "time" is difficult; there are
subtleties abound in implementation, the perspectives people come from,
and the language used in discussions. I'm going to provide a glossary to
establish common terminology, use these terms to analyze our current
state, offer a roadmap for solving the problem in stages, suggest a
format for timestamps, urge compatibility with "exotic" use cases, and
finally call for outside help with implementing a timezone aware agenda
system.

Summary and references are at the end.

This is an initial glossary compiled from various standards and sources;
it's incomplete, probably incorrect, and open to critique, but is useful
in articulating a possible road map forward.

• Time

  Time (concept)
        What clocks measure (Einstein)
  Time axis
        Mathematical representation of the succession in time according
        to the space-time model of instantaneous events along a unique
        axis (ISO).

  Instant (object)
        A single point on time axis (ISO).
  Moment in time
        See: instant.
  Mark
        A set of symbols related to the object, or carrying some
        symbolic meaning
  Time scale
        System of ordered marks which can be attributed to instants on
        the time axis , one instant being chosen as the origin. e.g.,
        GMT, UTC, TAI.
  Basis time
        See: time scale.
  Time (mark)
        The designation of an instant on a selected time scale, used in
        the sense of time of day.
  Time interval (object)
        part of the time axis limited by two instants and, unless
        otherwise stated, the limiting instants themselves a part of
        time limited by two instants or moments in time (ISO). The
        elapsed time between two events (NIST).
  Duration (object)
        as a quantity characterizing a time interval. These can be
        written in different formats.
  UTC
        Time scale with the same rate as International Atomic Time
        (TAI), but differing from TAI only by an integral number of
        seconds.
  Offset
        Constant duration difference between times of two time scales
        (ISO). i.e., a quantity to combine with a time scale to produce
        a wall time. e.g., Nepal uses a +5:45 offset from the UTC time
        scale.
  Time shift
        See: offset.
• Calendar and civil time
  Wall time
        what shows on the clock on the wall at a location. Like "local
        system time" but needn't reference a computer to do the
        calculation.
  Standard time
        Time scale derived from UTC, by a time shift established in a
        given location by the competent authority (ISO).
  Local system time
        Local system time is determined by applying the system's time
        zone offset and year offset values to UTC. The Time of day
        system value displays the local system time. Local system time
        and system time are used interchangeably.
  Time Zone
        A place/region. Can map between wall time and a time scale with
        a table and an offset. A set of rules for determining the local
        observed time (wall time) as it relates to incremental time (as
        used in most computing systems) for a particular geographical
        region. e.g., Brasília time presently has an offset of −03:00
        from the UTC time.
  Calendar event
        A calendar object that is commonly used to represent things that
        mark time or use time. Examples include meetings, appointments,
        anniversaries, start times, arrival times, closing times.

• Implementation These concern how we actually decide to record,
  reference, or manipulate time.
  Representation
        Expression indicating a time point, time interval or recurring
        time interval. e.g., [2023-02-02 Thu 12:58 +1w], "this next
        suday at 2pm EST", 3600 seconds from Unix epoch
  Format
        A description of the abstract form used for a representation.
        e.g., [YYYY-MM-DD] 'Explain in prose relative to this moment in
        time using locale and include your timezone'
  Encoding
        The method of storing a representation of time e.g., datestruct
        in memory, Org timestamp in body of heading, value of a
        "created" key in a database
  Format syntax
        Rules that allow for parsing a encoding unambiguously into some
        time scale.
  Timestamp (mark)
        An encoded representation in a selected format. e.g., 24/01/2023
        or 2023-01-24
  Delimiting syntax
        Rules that allow for detection and extraction of an encoding.
        Necessary for encodings embedded in prose. e.g., '[]' for org
        timestamps.

  Displayed time
        The formatting of a representation exposed to a user.
  Calculating
        Manipulating a set of time points, time intervals, or recurring
        time intervals. e.g., determining instant from an offset,
        comparing two representations in some lattice.
  Incremental time
        A datetime value consisting of monotonically increasing integer
        units measured from a specific moment in time (epoch). For
        example, the moment 1970-01-02T00:00:00.000Z might have an
        incremental time value (measured in milliseconds) of 86400000,
        since there are 86,400 seconds in a day and 1000 ms in a second.
  Floating time
        A wall time value without time zone or offset information. E.g.,
        2023-01-24 or 6:45pm.
  Fixed time
        A representation of a (past or future) UTC time.
  Absolute time
        See: fixed time.
  Unfixed time (from UTC)
        A representation which is not referenced to a past or future UTC
        time. e.g., Future time given as a local time in some specified
        time zone, where changes to the definition of that time zone
        (e.g., a political decision to enact or rescind daylight saving
        time) affect the instant in time corresponding with the
        timestamp.
• Time formats
  Incremental timestamp
        Timestamps that can be directly compared: their integer values
        determine which is earlier or later. e.g., Unix seconds since
        epoch.
  Field-Based timestamp
        Timestamps which must be normalized and their individual fields
        compared. Field based times can have certain kinds of logical
        operations performed on them (for example, rolling the month
        forward or back), while incremental time requires a logical
        transformation. e.g., ISO8601 style timestamps.
  ISO Basic format
        A format which omits hyphen separators e.g., YYYYMMDD
  ISO Extended format
        A format which includes hyphen separators e.g., YYYY-MM-DD
  Extended Date/Time Format EDTF
        An extension of the ISO 8601 created by the Library of Congress
        to cover date formats and conditions useful in metadata systems
        but not handled in the ISO standard.


What does format does Org have now?

• The format currently in use for timestamps is floating, field-based,
  and has a resolution/precision of minutes.

What kinds of representations would a calendar system capable of
handling timezones require?

• Instant (fixed)
  • This is referring to an unambiguous moment in time
  • e.g., 2007-02-03T05:00:00.000Z
• Offset (fixed)
  • This captures the idea of "when did it happen for the person who
    made the observation"
  • e.g., 2007-02-03T04:00:00.000+01:00
• Instant with explicit offset and zone (fixed)
  • e.g., 2007-01-01T02:00:00.000+01:00[America/Chicago]
• Zoned local date time (floating)
  • Tricky, requires decisions about how to interpret timestamps after
    political changes.
  • e.g., 2007-01-01T01:00:00.000[America/Chicago]


I claim that before dealing with the nuances of calendar appointments,
repeating events, agenda displays etc, that Org must first support
fixed/absolute time instead of just floating time. Without some basis
time scale the conversions from time zones and offsets to some
incremental time point is impossible. Resolving this prerequisite will
also simplify the timezone discussion because we won't be mixing
calendar issues with time issues.

What would a roadmap be?

• Design and implement an absolute and offset timestamp system
  • Decide on a time scale
  • Decide on a format and syntax
  • Implement instant timestamps
  • Implement offeset timestamps
• Design and implement the time zone aware calendar system This is a
  separate project.

What time scale should Org use?

There are only two decent options, either TAI or UTC. The rest of the
world has agreed upon UTC, we should too. Conversion to TAI can be done
by users or on export.

What format and syntax should Org use?

A heretical suggestion: We should abandon the day of week abbreviation
and use a new format.

The current format generates a three leter abbreviation of the day of
the week [2023-01-25 Wed 12:12]. I suggest supporting this as a
legacy/simple format but switch to a format/encoding like
[2023-01-25T15:13:42Z] for the new system. Specifically I'm advocating
for an extended ISO 8601 format, compatible with expanded dates and
Level 2 of the EDTF, with some (bracket?) notation surrounding it such
that Org can parse the syntax as a timestamp. I advocate further for the
use of durations and repeating intervals to follow the same standard
format. Thus instead of a range being formatted as:

[2023-01-25 Wed 13:57]–[2023-01-26 Thu 13:57]

it would be:

[2023-01-25T16:57:42Z/2023-01-26T16:57:42Z].

If the square bracket delimiter syntax is insufficient or too difficult
to parse unambiguously, we could just encapsulate the ISO format in a
sub-syntax (e.g., [&&(ISO format)] similar to the [%%(diary sexp)]
technique). This is ugly, but perhaps a stepping stone during
development to separate syntax parsing concerns from calculating etc.

What are the problems with the day of the week in existing format?

• The day of the week is redundant information and can be rebuilt from
  an ISO date Any user who wishes to display a format with the day of
  the week can do so.
• It's a nonstandard format Although the Org documentation says that the
  timestamps are "inspired by the standard ISO 8601 date/time format"
  the use of a day name is not contained in the ISO specification. The
  present Org format is actually two ISO components, the date and the
  time, with a non-standard day name sandwiched between them with space
  separators. Spaces are no longer allowed in the ISO format. By
  deviating from an existing standard we place the burden of parsing on
  ourselves and make sharing more difficult.
• Day of the week is irrelevant in many situations Looking at timestamps
  from a year ago it's often the case that what day of the week it was
  created is unimportant.

What are the advantages of switching to a standard format for the new
system?

• We can allow the legacy/simple system to coexist and interpret it as a
  floating timestamp This simplifies the issues of maintaining
  compatibility with existing org documents. It also placates those who
  have single user systems in a single time zone who do not want to have
  any calendar complexity imposed on them.
• We have a way of distinguishing new timestamps from legacy/simple ones
  By making a change in syntax we reduce (or eliminate?) the possibility
  of ambiguity between "which version" of a timestamp is being parsed. A
  legacy timestamp can be treated as such, and new timestamps are easily
  identified by the 'T' present instead of spaces, or in the delimiters
  wrapping the representation.
• We free ourselves from the constraints of the legacy timestamp format
  Trying to engineer a new syntax which also parses as an extension of
  the legacy one is more complex and embeds things like "day of the
  week" and the use of spaces as separators into this new system. Easier
  to have two side by side.
• We can defer to existing parsing and calculating systems There are
  already programs written which support the ISO standard and EDTF.
  • We can directly (or nearly directly) import the regular expressions
    and parsing mechanisms already written.
  • These enable decent testing suites as we build the system, as we can
    check against existing packages to see if our parsing and
    calculations agree.
  • Users who wish to use external libraries (irrespective of language
    or license) can extract the new timestamp and parse or calculate
    externally.
• Org is part of a standard
  • We are able to defer to experts and 35 years of knowledge rather
    than debate among ourselves
  • Interfacing with other programs is simplified as the area inside the
    delimiter notation can be passed as a string without parsing.
  • New users and collaborators can be onboarded faster without needing
    to learn a new system
  • Org documentation can refer to the standard instead of bearing the
    burden of exposition.
• The move to include time zones in the format is simplified
  • The ISO standard has recently adopted a format for time zones from
    RFC3339 and JAVAZDT, we can adhere to 8601 and keep things
    consistent.


What other perspectives should the new format support?

In addition to the representations necessary for a timezone aware
calendar system, I suggest the new format be compatible with two other
representations: finer/ arbitrary resolution for scientific work, and
Level 2 of the Extended Date/Time Format for bibliographic and metadata
systems.

Although most implementations come from the computer/database
perspective, where precision is limited by clock speed, scientific data
may be finer grained. Adopting a format which allows for arbitrary
precision enables Org to be useful in more scenarios. This would allow
data of higher frequency to be collected and stored into org headings as
a plain text database. Even if the data was stored externally it would
be convenient to be able to comment or discuss collected data by
referencing its time point.

The Extended Data/Time Format (EDTF) was designed by the Library of
Congress to address limitations of the ISO standard for metadata and
archival purposes. A draft specification was created in 2012 and EDTF
functionality has now been integrated into ISO 8601-2019. Of great
interest is the ability to express the concepts of uncertainty and
approximation. Archival work includes scenarios where the precise date
may be unknown, so a format was created with qualifiers capable of
handling these situations. In the EDTF format '1984?' expresses possibly
the year 1984, but not definitely, while '2004-06~' expresses year-month
approximate. This format has been implemented by multiple library
systems and in 2021 Wikibase added an extension to support EDTF.

The initial technical or code burden to support these perspectives is
minimal. Both can be parsed and calculated with by existing libraries,
and the functionality to actually calculate with them can be delayed.
The important thing is selecting a format which won't exclude them.

That these features are omitted in many systems as result of the
restricted domain and the data types used for storage; Org does not have
these constraints. Further, both of these communities tend to attract
people who are talented and sympathetic with (even occasionally funded
to support!) open source projects. By expanding Org's format to be more
inclusive we provide a haven rather than shutting them out.

The calendar implementation should elicit help from experts

Everyone seems in agreement that leveraging existing libraries is
desirable. We should also read and defer to documentation and
recommendations available from legitimate projects (e.g., W3, ISO). But
I think these are still insufficient for architecting an elegent time
system capable of satisfying the various perspectives. Calendar
applications in particular contain many edge cases and decisions about
display and interface etc. The knowldege concerning these is more likely
tacit than explicit, so I suggest we reach out to people who have
already designed/engineered solutions and get their input.

Here are some projects, organizations, or perspectives we could seek
help from:

• Calendar applications
  • ical standard
  • CalConnect standard
  • Thunderbird/lightning calendar
  • Google calendar
  • Outlook
  • Lotus notes
• Standard organizations
  • NIST
  • ISO
• Database or computer applications
  • SQL
  • Oracle
  • Java's time system
  • Numpy
  • Rust
• Archival or research users
  • Library of congress
  • Metadata systems
• Academic users
  • History
• Scientific users
  • Astronomers
  • Physicists
  • Chemists
  • Geologists
  • Metrologists

To summarize:

Org presently only supports simple floating timestamps. A calendar
system capable of handling time zones requires some form of fixed or
incremental timestamp with offsets. We can solve the absolute timestamp
system first, and deal with calendar concerns after. If we're
implementing a new time system the format and syntax should allow for
"exotic" use cases like arbitrary precision, uncertainty, and expanded
dates. The mechanics for calculating with those exotic cases needn't be
implemented by Org immediately.

We should adopt UTC as the time scale, EDTF (an extension of ISO 8601)
as the time format, and merely encapsulate this format with a delimiting
syntax (using brackets if possible) that Org can parse and distinguish
from the present format. The existing Org format should be considered
simple/legacy and can be interpretted or translated internally into the
new system as calculations require. The new format can be implemented
alongside the simple/legacy system.

This discussion of absolute offset timestamps should be split off from
timezone, calendar, and display concerns. Implementing a calendar
application with timezones is complicated and we should seek help from
those who have built the systems from before.

References:

Time

https://www.iso.org/obp/ui/#iso:std:iso:8601:-1:ed-1:v1:en
https://www.w3.org/International/articles/definitions-time/
https://www.ibm.com/docs/en/i/7.3?topic=concepts-time
https://tc39.es/proposal-temporal/docs/ambiguity.html

EDTF

https://www.loc.gov/standards/datetime/ Main page on EDTF
https://edtf.wikibase.wiki/wiki/Property:P1 Has examples of EDTF codes
https://www.wikibase.consulting/wikibase-edtf/ Wikibase implemented
EDTF in 2021
https://github.com/ProfessionalWiki/WikibaseEdtf#wikibase-edtf
https://github.com/corylown/edtf-humanize Transform EDTF strings into
human friendly display https://github.com/unt-libraries/edtf-validate
Validate EDTF strings https://github.com/plk/biblatex/issues/656
Discussion of Biblatex's implementation of EDTF
https://www.npmjs.com/package/edtf Parser for EDTF
https://github.com/inukshuk/edtf.js/tree/main Parser for EDTF

Implemention details

https://www.w3.org/TR/international-specs/#loc_time
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-syntax.html

Time zones

https://datatracker.ietf.org/doc/draft-ietf-sedate-datetime-extended/
An extension syntax for representing time zone. We should follow this.
Very helpful for implementing time zones.
https://www.w3.org/TR/timezone/#representing Very relevant
https://www.w3.org/International/core/2005/09/timezone.html#IDALFAT

Calendar and scheduling

https://www.calconnect.org/resources/glossary



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-27  6:06                                                             ` Sterling Hooten
@ 2023-01-27  6:09                                                               ` Daryl Manning
  2023-01-27  9:54                                                               ` Jean Louis
                                                                                 ` (2 subsequent siblings)
  3 siblings, 0 replies; 330+ messages in thread
From: Daryl Manning @ 2023-01-27  6:09 UTC (permalink / raw)
  To: Sterling Hooten
  Cc: Thomas S. Dye, Tim Cross, Jean Louis, Ihor Radchenko, rjhorn,
	emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 20981 bytes --]

Oh wow... this is a great idea. Good idea sending it round. Ought to make
things a bit easier when discussing and avoiding misunderstandings.  =]

On Fri, Jan 27, 2023 at 1:06 PM Sterling Hooten <hooten@gmail.com> wrote:

> Hi all,
>
> Collaborating around the subject of "time" is difficult; there are
> subtleties abound in implementation, the perspectives people come from,
> and the language used in discussions. I'm going to provide a glossary to
> establish common terminology, use these terms to analyze our current
> state, offer a roadmap for solving the problem in stages, suggest a
> format for timestamps, urge compatibility with "exotic" use cases, and
> finally call for outside help with implementing a timezone aware agenda
> system.
>
> Summary and references are at the end.
>
> This is an initial glossary compiled from various standards and sources;
> it's incomplete, probably incorrect, and open to critique, but is useful
> in articulating a possible road map forward.
>
> • Time
>
>   Time (concept)
>         What clocks measure (Einstein)
>   Time axis
>         Mathematical representation of the succession in time according
>         to the space-time model of instantaneous events along a unique
>         axis (ISO).
>
>   Instant (object)
>         A single point on time axis (ISO).
>   Moment in time
>         See: instant.
>   Mark
>         A set of symbols related to the object, or carrying some
>         symbolic meaning
>   Time scale
>         System of ordered marks which can be attributed to instants on
>         the time axis , one instant being chosen as the origin. e.g.,
>         GMT, UTC, TAI.
>   Basis time
>         See: time scale.
>   Time (mark)
>         The designation of an instant on a selected time scale, used in
>         the sense of time of day.
>   Time interval (object)
>         part of the time axis limited by two instants and, unless
>         otherwise stated, the limiting instants themselves a part of
>         time limited by two instants or moments in time (ISO). The
>         elapsed time between two events (NIST).
>   Duration (object)
>         as a quantity characterizing a time interval. These can be
>         written in different formats.
>   UTC
>         Time scale with the same rate as International Atomic Time
>         (TAI), but differing from TAI only by an integral number of
>         seconds.
>   Offset
>         Constant duration difference between times of two time scales
>         (ISO). i.e., a quantity to combine with a time scale to produce
>         a wall time. e.g., Nepal uses a +5:45 offset from the UTC time
>         scale.
>   Time shift
>         See: offset.
> • Calendar and civil time
>   Wall time
>         what shows on the clock on the wall at a location. Like "local
>         system time" but needn't reference a computer to do the
>         calculation.
>   Standard time
>         Time scale derived from UTC, by a time shift established in a
>         given location by the competent authority (ISO).
>   Local system time
>         Local system time is determined by applying the system's time
>         zone offset and year offset values to UTC. The Time of day
>         system value displays the local system time. Local system time
>         and system time are used interchangeably.
>   Time Zone
>         A place/region. Can map between wall time and a time scale with
>         a table and an offset. A set of rules for determining the local
>         observed time (wall time) as it relates to incremental time (as
>         used in most computing systems) for a particular geographical
>         region. e.g., Brasília time presently has an offset of −03:00
>         from the UTC time.
>   Calendar event
>         A calendar object that is commonly used to represent things that
>         mark time or use time. Examples include meetings, appointments,
>         anniversaries, start times, arrival times, closing times.
>
> • Implementation These concern how we actually decide to record,
>   reference, or manipulate time.
>   Representation
>         Expression indicating a time point, time interval or recurring
>         time interval. e.g., [2023-02-02 Thu 12:58 +1w], "this next
>         suday at 2pm EST", 3600 seconds from Unix epoch
>   Format
>         A description of the abstract form used for a representation.
>         e.g., [YYYY-MM-DD] 'Explain in prose relative to this moment in
>         time using locale and include your timezone'
>   Encoding
>         The method of storing a representation of time e.g., datestruct
>         in memory, Org timestamp in body of heading, value of a
>         "created" key in a database
>   Format syntax
>         Rules that allow for parsing a encoding unambiguously into some
>         time scale.
>   Timestamp (mark)
>         An encoded representation in a selected format. e.g., 24/01/2023
>         or 2023-01-24
>   Delimiting syntax
>         Rules that allow for detection and extraction of an encoding.
>         Necessary for encodings embedded in prose. e.g., '[]' for org
>         timestamps.
>
>   Displayed time
>         The formatting of a representation exposed to a user.
>   Calculating
>         Manipulating a set of time points, time intervals, or recurring
>         time intervals. e.g., determining instant from an offset,
>         comparing two representations in some lattice.
>   Incremental time
>         A datetime value consisting of monotonically increasing integer
>         units measured from a specific moment in time (epoch). For
>         example, the moment 1970-01-02T00:00:00.000Z might have an
>         incremental time value (measured in milliseconds) of 86400000,
>         since there are 86,400 seconds in a day and 1000 ms in a second.
>   Floating time
>         A wall time value without time zone or offset information. E.g.,
>         2023-01-24 or 6:45pm.
>   Fixed time
>         A representation of a (past or future) UTC time.
>   Absolute time
>         See: fixed time.
>   Unfixed time (from UTC)
>         A representation which is not referenced to a past or future UTC
>         time. e.g., Future time given as a local time in some specified
>         time zone, where changes to the definition of that time zone
>         (e.g., a political decision to enact or rescind daylight saving
>         time) affect the instant in time corresponding with the
>         timestamp.
> • Time formats
>   Incremental timestamp
>         Timestamps that can be directly compared: their integer values
>         determine which is earlier or later. e.g., Unix seconds since
>         epoch.
>   Field-Based timestamp
>         Timestamps which must be normalized and their individual fields
>         compared. Field based times can have certain kinds of logical
>         operations performed on them (for example, rolling the month
>         forward or back), while incremental time requires a logical
>         transformation. e.g., ISO8601 style timestamps.
>   ISO Basic format
>         A format which omits hyphen separators e.g., YYYYMMDD
>   ISO Extended format
>         A format which includes hyphen separators e.g., YYYY-MM-DD
>   Extended Date/Time Format EDTF
>         An extension of the ISO 8601 created by the Library of Congress
>         to cover date formats and conditions useful in metadata systems
>         but not handled in the ISO standard.
>
>
> What does format does Org have now?
>
> • The format currently in use for timestamps is floating, field-based,
>   and has a resolution/precision of minutes.
>
> What kinds of representations would a calendar system capable of
> handling timezones require?
>
> • Instant (fixed)
>   • This is referring to an unambiguous moment in time
>   • e.g., 2007-02-03T05:00:00.000Z
> • Offset (fixed)
>   • This captures the idea of "when did it happen for the person who
>     made the observation"
>   • e.g., 2007-02-03T04:00:00.000+01:00
> • Instant with explicit offset and zone (fixed)
>   • e.g., 2007-01-01T02:00:00.000+01:00[America/Chicago]
> • Zoned local date time (floating)
>   • Tricky, requires decisions about how to interpret timestamps after
>     political changes.
>   • e.g., 2007-01-01T01:00:00.000[America/Chicago]
>
>
> I claim that before dealing with the nuances of calendar appointments,
> repeating events, agenda displays etc, that Org must first support
> fixed/absolute time instead of just floating time. Without some basis
> time scale the conversions from time zones and offsets to some
> incremental time point is impossible. Resolving this prerequisite will
> also simplify the timezone discussion because we won't be mixing
> calendar issues with time issues.
>
> What would a roadmap be?
>
> • Design and implement an absolute and offset timestamp system
>   • Decide on a time scale
>   • Decide on a format and syntax
>   • Implement instant timestamps
>   • Implement offeset timestamps
> • Design and implement the time zone aware calendar system This is a
>   separate project.
>
> What time scale should Org use?
>
> There are only two decent options, either TAI or UTC. The rest of the
> world has agreed upon UTC, we should too. Conversion to TAI can be done
> by users or on export.
>
> What format and syntax should Org use?
>
> A heretical suggestion: We should abandon the day of week abbreviation
> and use a new format.
>
> The current format generates a three leter abbreviation of the day of
> the week [2023-01-25 Wed 12:12]. I suggest supporting this as a
> legacy/simple format but switch to a format/encoding like
> [2023-01-25T15:13:42Z] for the new system. Specifically I'm advocating
> for an extended ISO 8601 format, compatible with expanded dates and
> Level 2 of the EDTF, with some (bracket?) notation surrounding it such
> that Org can parse the syntax as a timestamp. I advocate further for the
> use of durations and repeating intervals to follow the same standard
> format. Thus instead of a range being formatted as:
>
> [2023-01-25 Wed 13:57]–[2023-01-26 Thu 13:57]
>
> it would be:
>
> [2023-01-25T16:57:42Z/2023-01-26T16:57:42Z].
>
> If the square bracket delimiter syntax is insufficient or too difficult
> to parse unambiguously, we could just encapsulate the ISO format in a
> sub-syntax (e.g., [&&(ISO format)] similar to the [%%(diary sexp)]
> technique). This is ugly, but perhaps a stepping stone during
> development to separate syntax parsing concerns from calculating etc.
>
> What are the problems with the day of the week in existing format?
>
> • The day of the week is redundant information and can be rebuilt from
>   an ISO date Any user who wishes to display a format with the day of
>   the week can do so.
> • It's a nonstandard format Although the Org documentation says that the
>   timestamps are "inspired by the standard ISO 8601 date/time format"
>   the use of a day name is not contained in the ISO specification. The
>   present Org format is actually two ISO components, the date and the
>   time, with a non-standard day name sandwiched between them with space
>   separators. Spaces are no longer allowed in the ISO format. By
>   deviating from an existing standard we place the burden of parsing on
>   ourselves and make sharing more difficult.
> • Day of the week is irrelevant in many situations Looking at timestamps
>   from a year ago it's often the case that what day of the week it was
>   created is unimportant.
>
> What are the advantages of switching to a standard format for the new
> system?
>
> • We can allow the legacy/simple system to coexist and interpret it as a
>   floating timestamp This simplifies the issues of maintaining
>   compatibility with existing org documents. It also placates those who
>   have single user systems in a single time zone who do not want to have
>   any calendar complexity imposed on them.
> • We have a way of distinguishing new timestamps from legacy/simple ones
>   By making a change in syntax we reduce (or eliminate?) the possibility
>   of ambiguity between "which version" of a timestamp is being parsed. A
>   legacy timestamp can be treated as such, and new timestamps are easily
>   identified by the 'T' present instead of spaces, or in the delimiters
>   wrapping the representation.
> • We free ourselves from the constraints of the legacy timestamp format
>   Trying to engineer a new syntax which also parses as an extension of
>   the legacy one is more complex and embeds things like "day of the
>   week" and the use of spaces as separators into this new system. Easier
>   to have two side by side.
> • We can defer to existing parsing and calculating systems There are
>   already programs written which support the ISO standard and EDTF.
>   • We can directly (or nearly directly) import the regular expressions
>     and parsing mechanisms already written.
>   • These enable decent testing suites as we build the system, as we can
>     check against existing packages to see if our parsing and
>     calculations agree.
>   • Users who wish to use external libraries (irrespective of language
>     or license) can extract the new timestamp and parse or calculate
>     externally.
> • Org is part of a standard
>   • We are able to defer to experts and 35 years of knowledge rather
>     than debate among ourselves
>   • Interfacing with other programs is simplified as the area inside the
>     delimiter notation can be passed as a string without parsing.
>   • New users and collaborators can be onboarded faster without needing
>     to learn a new system
>   • Org documentation can refer to the standard instead of bearing the
>     burden of exposition.
> • The move to include time zones in the format is simplified
>   • The ISO standard has recently adopted a format for time zones from
>     RFC3339 and JAVAZDT, we can adhere to 8601 and keep things
>     consistent.
>
>
> What other perspectives should the new format support?
>
> In addition to the representations necessary for a timezone aware
> calendar system, I suggest the new format be compatible with two other
> representations: finer/ arbitrary resolution for scientific work, and
> Level 2 of the Extended Date/Time Format for bibliographic and metadata
> systems.
>
> Although most implementations come from the computer/database
> perspective, where precision is limited by clock speed, scientific data
> may be finer grained. Adopting a format which allows for arbitrary
> precision enables Org to be useful in more scenarios. This would allow
> data of higher frequency to be collected and stored into org headings as
> a plain text database. Even if the data was stored externally it would
> be convenient to be able to comment or discuss collected data by
> referencing its time point.
>
> The Extended Data/Time Format (EDTF) was designed by the Library of
> Congress to address limitations of the ISO standard for metadata and
> archival purposes. A draft specification was created in 2012 and EDTF
> functionality has now been integrated into ISO 8601-2019. Of great
> interest is the ability to express the concepts of uncertainty and
> approximation. Archival work includes scenarios where the precise date
> may be unknown, so a format was created with qualifiers capable of
> handling these situations. In the EDTF format '1984?' expresses possibly
> the year 1984, but not definitely, while '2004-06~' expresses year-month
> approximate. This format has been implemented by multiple library
> systems and in 2021 Wikibase added an extension to support EDTF.
>
> The initial technical or code burden to support these perspectives is
> minimal. Both can be parsed and calculated with by existing libraries,
> and the functionality to actually calculate with them can be delayed.
> The important thing is selecting a format which won't exclude them.
>
> That these features are omitted in many systems as result of the
> restricted domain and the data types used for storage; Org does not have
> these constraints. Further, both of these communities tend to attract
> people who are talented and sympathetic with (even occasionally funded
> to support!) open source projects. By expanding Org's format to be more
> inclusive we provide a haven rather than shutting them out.
>
> The calendar implementation should elicit help from experts
>
> Everyone seems in agreement that leveraging existing libraries is
> desirable. We should also read and defer to documentation and
> recommendations available from legitimate projects (e.g., W3, ISO). But
> I think these are still insufficient for architecting an elegent time
> system capable of satisfying the various perspectives. Calendar
> applications in particular contain many edge cases and decisions about
> display and interface etc. The knowldege concerning these is more likely
> tacit than explicit, so I suggest we reach out to people who have
> already designed/engineered solutions and get their input.
>
> Here are some projects, organizations, or perspectives we could seek
> help from:
>
> • Calendar applications
>   • ical standard
>   • CalConnect standard
>   • Thunderbird/lightning calendar
>   • Google calendar
>   • Outlook
>   • Lotus notes
> • Standard organizations
>   • NIST
>   • ISO
> • Database or computer applications
>   • SQL
>   • Oracle
>   • Java's time system
>   • Numpy
>   • Rust
> • Archival or research users
>   • Library of congress
>   • Metadata systems
> • Academic users
>   • History
> • Scientific users
>   • Astronomers
>   • Physicists
>   • Chemists
>   • Geologists
>   • Metrologists
>
> To summarize:
>
> Org presently only supports simple floating timestamps. A calendar
> system capable of handling time zones requires some form of fixed or
> incremental timestamp with offsets. We can solve the absolute timestamp
> system first, and deal with calendar concerns after. If we're
> implementing a new time system the format and syntax should allow for
> "exotic" use cases like arbitrary precision, uncertainty, and expanded
> dates. The mechanics for calculating with those exotic cases needn't be
> implemented by Org immediately.
>
> We should adopt UTC as the time scale, EDTF (an extension of ISO 8601)
> as the time format, and merely encapsulate this format with a delimiting
> syntax (using brackets if possible) that Org can parse and distinguish
> from the present format. The existing Org format should be considered
> simple/legacy and can be interpretted or translated internally into the
> new system as calculations require. The new format can be implemented
> alongside the simple/legacy system.
>
> This discussion of absolute offset timestamps should be split off from
> timezone, calendar, and display concerns. Implementing a calendar
> application with timezones is complicated and we should seek help from
> those who have built the systems from before.
>
> References:
>
> Time
>
> https://www.iso.org/obp/ui/#iso:std:iso:8601:-1:ed-1:v1:en
> https://www.w3.org/International/articles/definitions-time/
> https://www.ibm.com/docs/en/i/7.3?topic=concepts-time
> https://tc39.es/proposal-temporal/docs/ambiguity.html
>
> EDTF
>
> https://www.loc.gov/standards/datetime/ Main page on EDTF
> https://edtf.wikibase.wiki/wiki/Property:P1 Has examples of EDTF codes
> https://www.wikibase.consulting/wikibase-edtf/ Wikibase implemented
> EDTF in 2021
> https://github.com/ProfessionalWiki/WikibaseEdtf#wikibase-edtf
> https://github.com/corylown/edtf-humanize Transform EDTF strings into
> human friendly display https://github.com/unt-libraries/edtf-validate
> Validate EDTF strings https://github.com/plk/biblatex/issues/656
> Discussion of Biblatex's implementation of EDTF
> https://www.npmjs.com/package/edtf Parser for EDTF
> https://github.com/inukshuk/edtf.js/tree/main Parser for EDTF
>
> Implemention details
>
> https://www.w3.org/TR/international-specs/#loc_time
> https://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-syntax.html
>
> Time zones
>
> https://datatracker.ietf.org/doc/draft-ietf-sedate-datetime-extended/
> An extension syntax for representing time zone. We should follow this.
> Very helpful for implementing time zones.
> https://www.w3.org/TR/timezone/#representing Very relevant
> https://www.w3.org/International/core/2005/09/timezone.html#IDALFAT
>
> Calendar and scheduling
>
> https://www.calconnect.org/resources/glossary
>
>

[-- Attachment #2: Type: text/html, Size: 24783 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-27  6:06                                                             ` Sterling Hooten
  2023-01-27  6:09                                                               ` Daryl Manning
@ 2023-01-27  9:54                                                               ` Jean Louis
  2023-01-27 21:04                                                                 ` Tim Cross
  2023-01-27 11:09                                                               ` Ihor Radchenko
  2023-01-30 12:30                                                               ` [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Ihor Radchenko
  3 siblings, 1 reply; 330+ messages in thread
From: Jean Louis @ 2023-01-27  9:54 UTC (permalink / raw)
  To: Sterling Hooten
  Cc: Thomas S. Dye, Tim Cross, Ihor Radchenko, Daryl Manning, rjhorn,
	emacs-orgmode

* Sterling Hooten <hooten@gmail.com> [2023-01-27 09:06]:
>   Offset
>         Constant duration difference between times of two time scales
>         (ISO). i.e., a quantity to combine with a time scale to produce
>         a wall time. e.g., Nepal uses a +5:45 offset from the UTC time
>         scale.

I would be careful calling it constant as time offset is changing
depending of daylight saving time. It is not constant.

Time offset time stamp may be derived from time zone time. I am sure
about this.

Time zone time stamp cannot be unambiguously derived from time
offset. I am mostly sure about this.

> What kinds of representations would a calendar system capable of
> handling timezones require?
> 
> • Instant (fixed)
>   • This is referring to an unambiguous moment in time
>   • e.g., 2007-02-03T05:00:00.000Z
> • Offset (fixed)
>   • This captures the idea of "when did it happen for the person who
>     made the observation"
>   • e.g., 2007-02-03T04:00:00.000+01:00

Offset is not that fixed, maybe from viewpoint of storage as maybe it
is considered fixed in it's representation, but you have to keep in
mind that time offset by it's definition is changing itself, suddenly,
depending of daylight saving and time zone.

I am trying to find well described reference to read, try here:

Time Zones vs. Offsets – What's the Difference? Which Is Best?:
https://spin.atomicobject.com/2016/07/06/time-zones-offsets/

,----
| Putting It All Together
| 
| Given a time zone and a UTC time, you can know the offset—and
| therefore the local time. Given a local time and an offset, you can
| know UTC time, but you do not know which time zone you’re in (because
| multiple timezones have the same offset). Given UTC and an offset, you
| can know the local time. Given a time zone and an offset, you don’t
| know much. That’s why a calendar systems work with time zones,
| offsets, and UTC; we need the offset to go from local time to UTC, and
| we need the time zone to go from UTC to local time.
`----

> • Instant with explicit offset and zone (fixed)
>   • e.g., 2007-01-01T02:00:00.000+01:00[America/Chicago]
> • Zoned local date time (floating)
>   • Tricky, requires decisions about how to interpret timestamps after
>     political changes.
>   • e.g., 2007-01-01T01:00:00.000[America/Chicago]

For calendars it is good to follow recommendation Internet Calendaring
and Schedulingn Core Object Specification (iCalendar)

iCalendar - Date and time format:
https://en.wikipedia.org/wiki/ICalendar#Date_and_time_format

In other words it is good to follow what other successful applications
are already doing. 

For example, if you open Evolution calendar in Gnome:

evolution -c calendar

and make task, and save that task as iCalendar, then you can see what
time stamp format is used there for exchange purposes.

Representation for user using Org file is different from
representation for sharing purposes, as user already (mostly) have
specified local time zone on this computer, while sharing object such
as iCalendar file must take that information of local time zone and
store it unambiguously.

> I claim that before dealing with the nuances of calendar appointments,
> repeating events, agenda displays etc, that Org must first support
> fixed/absolute time instead of just floating time. 

Parameters needed to make it fixed are already in computer, only
disconnected. 

changing this time stamp for Org:
<2023-01-27 Fri 10:18>
to something "fixed" would break Org compatibility for past Org files.

While new unambigious time stamp formats may be introduced, the way to
go is with past time stamps is to understand the time stamp for
representation and calculation purposes by using OR logical function:

timestamp-time-zone OR heading-time-zone OR file-time-zone OR system-time-zone

as by using those, for now still disconnected parameters, one can get
the fixed time for representation purposes (Org export or sharing) or
calculation purposes (on local computer and by using some shared Org
objects).

> Without some basis time scale the conversions from time zones and
> offsets to some incremental time point is impossible. Resolving this
> prerequisite will also simplify the timezone discussion because we
> won't be mixing calendar issues with time issues.

I guess that OR consideration above may remedy it and keep past
compatibility while expanding more specific time stamp as option.

> What would a roadmap be?
> 
> • Design and implement an absolute and offset timestamp system
>   • Decide on a time scale
>   • Decide on a format and syntax
>   • Implement instant timestamps
>   • Implement offeset timestamps
> • Design and implement the time zone aware calendar system This is a
>   separate project.

Sounds complex to me and over board for program that tries to define
data type by using simple text written ambiguously by many people.

> What format and syntax should Org use?
> 
> A heretical suggestion: We should abandon the day of week abbreviation
> and use a new format.

Day of week abbreviation is useful. Full day is even more
useful. Removing what is useful is not useful.

There is no calendar application that I know that does not specify
days of week.

> The current format generates a three leter abbreviation of the day of
> the week [2023-01-25 Wed 12:12]. I suggest supporting this as a
> legacy/simple format but switch to a format/encoding like
> [2023-01-25T15:13:42Z] for the new system.

Which format is more useful for people?

I find [2023-01-25 Wed 12:12] more useful, rather than the other one,
for reason that it has clear date, day of week and time.

And I always consider that Emacs packages like Org shall be designed
to be useful to majority of people, rather than to few who may have
the idea very right, but not comforting the majority of people.

There is no calendar application that I know that by default uses UTC
format, which representation is of course contradictory to large
majority of time zones and to people got used to, to display their
time in their time zone. 

> Specifically I'm advocating for an extended ISO 8601 format,
> compatible with expanded dates and Level 2 of the EDTF, with some
> (bracket?) notation surrounding it such that Org can parse the
> syntax as a timestamp. I advocate further for the use of durations
> and repeating intervals to follow the same standard format. Thus
> instead of a range being formatted as:
> 
> [2023-01-25 Wed 13:57]–[2023-01-26 Thu 13:57]
> 
> it would be:
> 
> [2023-01-25T16:57:42Z/2023-01-26T16:57:42Z].

Such representations should not become default to users, but used in
representation, or sharing, or re-writing of time stamps by user
option. 

Using such time stamps by default in Org file is confusing for people
and showing time which is not their time to majority of people.

I am surprised and in same time disappointed, that your analysis leads
to conclusion that users should represent their time in UTC.

> What are the problems with the day of the week in existing format?
> 
> • The day of the week is redundant information and can be rebuilt from
>   an ISO date Any user who wishes to display a format with the day of
>   the week can do so.

It is redundant or who? 

Is it redundant for majority of Org users?

Maybe it is reundant for you?

For some people?

Do you know for who?

I never even heard some user here complaining for day of week
representation. Let me add one big fricking LOL here.

Any user who wishes to do anything could be left to program it alone
and do what they wish.

But programming should be useful to people by majority of demands and
wants.

> • It's a nonstandard format

The statement above miss the context. Non-standard where? How? In
which context?

In context of Org file is prime standard.

In context of Evolution calendar it is not standard, but neither the
graphical representation of a task in such calendar is standard.

Program's representation of time is NOT REQUIRED to be standard,
rather it shall be useful to user using the program to understand the
information. 

In other words, representation shall be simple and readable,
understandable!

> Although the Org documentation says that the timestamps are
> "inspired by the standard ISO 8601 date/time format" the use of a
> day name is not contained in the ISO specification.

Being inspired does not mean "conforming to ISO 8601"

There is distinction, different context, of using time stamps inside
of Org file, and different context of "worldwide exchange and
communication of date and time related data", see ISO 8601 purposes.

I fully agree that in exchange or sharing of date/time information,
Org program should sometims use ISO 8601, but not in all exports.

For example in HTML export it is enough to say time and time zone. But
some people like to export it in ISO 8601. Such considerations could
be user option.

Right now HTML export is ambiguous as it does not have time zone.

The usage of ISO 8601 should rather depend on method exchange or
exporting.

But it should not be user's representation, as user is not a robot, or
program that is supposed to read computer-meant time stamps.

And you forgot to list disadvantages of making Org for robots, not for
human.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-27  6:06                                                             ` Sterling Hooten
  2023-01-27  6:09                                                               ` Daryl Manning
  2023-01-27  9:54                                                               ` Jean Louis
@ 2023-01-27 11:09                                                               ` Ihor Radchenko
  2023-01-27 12:49                                                                 ` Sterling Hooten
                                                                                   ` (2 more replies)
  2023-01-30 12:30                                                               ` [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Ihor Radchenko
  3 siblings, 3 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-27 11:09 UTC (permalink / raw)
  To: Sterling Hooten
  Cc: Thomas S. Dye, Tim Cross, Jean Louis, Daryl Manning, rjhorn,
	emacs-orgmode

First of all, thanks for the detailed suggestion!
I will need more time to look through the provided links and think about
the ideas.

I will provide one important consideration you missed in the below comment.

Sterling Hooten <hooten@gmail.com> writes:

> What format and syntax should Org use?
>
> A heretical suggestion: We should abandon the day of week abbreviation
> and use a new format.
> ...
> [2023-01-25 Wed 13:57]–[2023-01-26 Thu 13:57]
>
> it would be:
>
> [2023-01-25T16:57:42Z/2023-01-26T16:57:42Z].

Following ISO and other standards is indeed a reasonable idea. However,
the standards are not necessarily designed for human consumption.
In contrast, Org mode is designed to be read by humans as well, even
without Emacs - just as plain text.

Design for human consumption is one of the reasons we do provide the
redundant information like week day (I personally did find it extremely
useful on multiple occasions) and do use spaces, deviating from ISO. The
above ISO example is barely readable by humans. Another example from
wiki page of ISO 8601 is even worse: R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M

And we need to deviate from ISO 8601 anyway. At least, because it does
not define time zones, only absolute UTC offsets. So, the ability to
conform with the existing formats remains questionable.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-27 11:09                                                               ` Ihor Radchenko
@ 2023-01-27 12:49                                                                 ` Sterling Hooten
  2023-01-27 13:00                                                                   ` Ihor Radchenko
                                                                                     ` (2 more replies)
  2023-01-27 20:58                                                                 ` Tim Cross
  2023-01-30 11:25                                                                 ` Greg Minshall
  2 siblings, 3 replies; 330+ messages in thread
From: Sterling Hooten @ 2023-01-27 12:49 UTC (permalink / raw)
  To: Ihor Radchenko
  Cc: Thomas S. Dye, Tim Cross, Jean Louis, Daryl Manning, rjhorn,
	emacs-orgmode

Thanks for the quick feedback!

> On 2023-01-27, at 08:09, Ihor Radchenko <yantar92@posteo.net> wrote:
> 
> Following ISO and other standards is indeed a reasonable idea. However,
> the standards are not necessarily designed for human consumption.
> In contrast, Org mode is designed to be read by humans as well, even
> without Emacs - just as plain text.
> 
> Design for human consumption is one of the reasons we do provide the
> redundant information like week day (I personally did find it extremely
> useful on multiple occasions) and do use spaces, deviating from ISO. The
> above ISO example is barely readable by humans. Another example from
> wiki page of ISO 8601 is even worse: R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M

Certainly agree that the ISO format can be difficult for humans to read, both from 
the lack of spaces and terse syntax.

This isn’t (much) of a problem from a display format perspective because we can parse 
the encoded format and present the user with a human readable version. So the readability 
issue is more about the encoded format. But unlike the display format, which could follow 
whatever grammar or locale preference of the user, the encoded format must be 
unambiguously parseable. If it’s possible to make the ISO format more human readable 
while still preserving parseability this could be viable.

I’m less arguing against the option for encoding things in a variation of the ISO standard, 
but urging that Org support using an encoding of the ISO format in its raw state.

> And we need to deviate from ISO 8601 anyway. At least, because it does
> not define time zones, only absolute UTC offsets. So, the ability to
> conform with the existing formats remains questionable.

This is correct for the 2019 version of the ISO 8601.

From my understanding the newest ISO draft is incorporating an existing syntax used 
in java.time.ZonedDateTime [JAVAZDT] to allow for time zones. So we could still aim for 
compliance with published standards.

The Internet Extended Date/Time Format  (IXDTF) is a forthcoming standard which 
defines an extension syntax for timestamps as specified in [RFC3339]  which itself is 
compatible with the [JAVAZDT] syntax.

The IXDTF is of particular interest in this situation because the format provides a 
general way to attach any additional information to a timestamp. The authors have done 
a great job of lucidly explaining some of the nuances of timestamps.

https://datatracker.ietf.org/doc/draft-ietf-sedate-datetime-extended/

> I will need more time to look through the provided links and think about
> the ideas.

Look forward to your comments!



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-27 12:49                                                                 ` Sterling Hooten
@ 2023-01-27 13:00                                                                   ` Ihor Radchenko
  2023-01-27 15:03                                                                   ` Jean Louis
  2023-01-30 13:08                                                                   ` Ihor Radchenko
  2 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-27 13:00 UTC (permalink / raw)
  To: Sterling Hooten
  Cc: Thomas S. Dye, Tim Cross, Jean Louis, Daryl Manning, rjhorn,
	emacs-orgmode

Sterling Hooten <hooten@gmail.com> writes:

>> Design for human consumption is one of the reasons we do provide the
>> redundant information like week day (I personally did find it extremely
>> useful on multiple occasions) and do use spaces, deviating from ISO. The
>> above ISO example is barely readable by humans. Another example from
>> wiki page of ISO 8601 is even worse: R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M
>
> Certainly agree that the ISO format can be difficult for humans to read, both from 
> the lack of spaces and terse syntax.
>
> This isn’t (much) of a problem from a display format perspective because we can parse 
> the encoded format and present the user with a human readable version. So the readability 
> issue is more about the encoded format. But unlike the display format, which could follow 
> whatever grammar or locale preference of the user, the encoded format must be 
> unambiguously parseable. If it’s possible to make the ISO format more human readable 
> while still preserving parseability this could be viable.

You miss that Org should be readable outside Emacs and also outside text
editor that understands Org specifically. Ideally, one should be able to
read Org files in raw form, using notepad or simple cat command. There
is no such thing as "encoding" vs. "display". The encoded format should
be readable by default as well.

Think of Org tables - would take a great care adding all the redundant
spaces to align things nicely despite an alternative possible approach
purely using fontification. Same for heading tags where the alignment is
done by extra spaces.

> I’m less arguing against the option for encoding things in a variation of the ISO standard, 
> but urging that Org support using an encoding of the ISO format in its raw state.

I do not mind supporting raw ISO as an option. But not as the default representation.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-27 12:49                                                                 ` Sterling Hooten
  2023-01-27 13:00                                                                   ` Ihor Radchenko
@ 2023-01-27 15:03                                                                   ` Jean Louis
  2023-01-30 13:08                                                                   ` Ihor Radchenko
  2 siblings, 0 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-27 15:03 UTC (permalink / raw)
  To: Sterling Hooten
  Cc: Ihor Radchenko, Thomas S. Dye, Tim Cross, Daryl Manning, rjhorn,
	emacs-orgmode

* Sterling Hooten <hooten@gmail.com> [2023-01-27 15:50]:
> This isn’t (much) of a problem from a display format perspective
> because we can parse the encoded format and present the user with a
> human readable version.

Org files shall still be readable as plain text IMHO.

As Org textual structure has been adopted by other text editors, and
various applications, it is not feasible to expect that other
editors and applications would be re-writing the displayed text to
show to user their local time.

Only user's local time is friendly to user.

Other options may be added, though focus should be on helping human
and making things easy.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-27 11:09                                                               ` Ihor Radchenko
  2023-01-27 12:49                                                                 ` Sterling Hooten
@ 2023-01-27 20:58                                                                 ` Tim Cross
  2023-01-30 11:25                                                                 ` Greg Minshall
  2 siblings, 0 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-27 20:58 UTC (permalink / raw)
  To: Ihor Radchenko
  Cc: Sterling Hooten, Thomas S. Dye, Jean Louis, Daryl Manning, rjhorn,
	emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> First of all, thanks for the detailed suggestion!
> I will need more time to look through the provided links and think about
> the ideas.
>
> I will provide one important consideration you missed in the below comment.
>
> Sterling Hooten <hooten@gmail.com> writes:
>
>> What format and syntax should Org use?
>>
>> A heretical suggestion: We should abandon the day of week abbreviation
>> and use a new format.
>> ...
>> [2023-01-25 Wed 13:57]–[2023-01-26 Thu 13:57]
>>
>> it would be:
>>
>> [2023-01-25T16:57:42Z/2023-01-26T16:57:42Z].
>
> Following ISO and other standards is indeed a reasonable idea. However,
> the standards are not necessarily designed for human consumption.
> In contrast, Org mode is designed to be read by humans as well, even
> without Emacs - just as plain text.
>
> Design for human consumption is one of the reasons we do provide the
> redundant information like week day (I personally did find it extremely
> useful on multiple occasions) and do use spaces, deviating from ISO. The
> above ISO example is barely readable by humans. Another example from
> wiki page of ISO 8601 is even worse: R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M
>
> And we need to deviate from ISO 8601 anyway. At least, because it does
> not define time zones, only absolute UTC offsets. So, the ability to
> conform with the existing formats remains questionable.


I strongly agree with Ihor here. We want our timestamps to be easily
read and understood by users. I have also found the redundant day of the
week information very useful.

While we could argue that with overlays or similar, you could get the
best of both worlds i.e. a storage format which is easy for functions to
parse and a display format which is easy for humans to parse, but that
would also work only when you view your org files within org mode. One
of the benefits of org mode is its plain text nature and that you can
read most org mode files 'raw' and they are quite easy to understand. 



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-27  9:54                                                               ` Jean Louis
@ 2023-01-27 21:04                                                                 ` Tim Cross
  2023-01-29  4:09                                                                   ` Jean Louis
  0 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-27 21:04 UTC (permalink / raw)
  To: Jean Louis
  Cc: Sterling Hooten, Thomas S. Dye, Ihor Radchenko, Daryl Manning,
	rjhorn, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

> * Sterling Hooten <hooten@gmail.com> [2023-01-27 09:06]:
>>   Offset
>>         Constant duration difference between times of two time scales
>>         (ISO). i.e., a quantity to combine with a time scale to produce
>>         a wall time. e.g., Nepal uses a +5:45 offset from the UTC time
>>         scale.
>
> I would be careful calling it constant as time offset is changing
> depending of daylight saving time. It is not constant.
>
> Time offset time stamp may be derived from time zone time. I am sure
> about this.
>
> Time zone time stamp cannot be unambiguously derived from time
> offset. I am mostly sure about this.
>
>> What kinds of representations would a calendar system capable of
>> handling timezones require?
>> 
>> • Instant (fixed)
>>   • This is referring to an unambiguous moment in time
>>   • e.g., 2007-02-03T05:00:00.000Z
>> • Offset (fixed)
>>   • This captures the idea of "when did it happen for the person who
>>     made the observation"
>>   • e.g., 2007-02-03T04:00:00.000+01:00
>
> Offset is not that fixed, maybe from viewpoint of storage as maybe it
> is considered fixed in it's representation, but you have to keep in
> mind that time offset by it's definition is changing itself, suddenly,
> depending of daylight saving and time zone.
>

I think your misinterpreting the intent here. If you specify a timestamp
with offset, it is fixed. It does not change with daylight savings or
any other change in rules for a time zone. It does not even specify a
time zone. While it is true that a specific location may have time zone
changes or that the offset from UTC might change as a result of daylight
savings, an offset specified in a times stamp does not change and is
fixed.  This is one of the limitaiton with using offset.

I also think it is a mistake (which I've seen others suggest in this
thread) to equate an offset as being an abbreviation for a time
zone. For example, some have suggested things like +10000 being the same
as AEST and both being abbreviations for Australia/Sydney outside of
daylight savings periods. I think that is incorrect. +1000 is a fixed
offset from UTC and while it may be the same offset used in a time zone
abbreviation like AEST or in a full time zone specification like
Australia/Sydney, it is not a time zone specification, only an offset
for a specific point in time.


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)
  2023-01-26 16:31                                                                               ` Thomas S. Dye
@ 2023-01-27 21:21                                                                                 ` Tim Cross
  0 siblings, 0 replies; 330+ messages in thread
From: Tim Cross @ 2023-01-27 21:21 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Max Nikulin, emacs-orgmode

"Thomas S. Dye" <tsd@tsdye.online> writes:

> No, I don't think you've missed anything significant.  Thanks very much for your patience
> during a discussion that was interesting for me.  I learned quite a bit from you and the
> other contributors to the thread and look forward now to learning how Org mode evolves to
> handle events and occurrences.
>
> Let me know if you have questions.
>

Agreed. I also think this latest discussion is extremely valuable as
coming up with some clear terminology which can be used to reference
different use cases for timestamps is very likely going to make
documentation and exmaples/tutorials much cleaner and could help define
a more intuitive interface which helps users select the right option in
the right circumstance.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
@ 2023-01-28  6:26 Max Nikulin
  0 siblings, 0 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-28  6:26 UTC (permalink / raw)
  To: Sterling Hooten; +Cc: emacs-orgmode

Sterling, thank you very much for the list of references. I was not 
aware of EDTF activity or the proposal for JavaScript.

I do not mind to have better precision for timestamps. Minutes are too 
coarse. However I would consider with low priority.

I would prefer to postpone some discussions now. At the current moment 
just be aware than one more person may have another opinion. Redundant 
fields are useful for humans, in addition, they allow to detect 
inconsistency. Date and time format with spaces are more friendly to 
humans as well. "T" hampers readability. So I feel some kind of internal 
conflict trying to achieve following standards, backward compatibility, 
and human readability simultaneously. I am unsure what is the proper 
solution.

The following is what I consider as more serious issues:

On 27/01/2023 13:06, Sterling Hooten wrote:
>    Duration (object)
>          as a quantity characterizing a time interval. These can be
>          written in different formats.

Interval, duration, elapsed time are tricky. I do not have preferences 
whose definitions we should follow. Just an example: (info "(libc) Time 
Basics") https://www.gnu.org/software/libc/manual/html_node/Time-Basics.html

Notice that 1 day does not necessary means 24 hours. Depending on 
starting day (e.g. before DST) other relations may be used, either 23 or 
25 hours (usually). It is still 1 day. The way to specify interval 
should be chosen depending on application.

Another case is January, 31 + 1 month. It actually may mean last day of 
January, so expected result may be February, 28 or 29. This case 
February, 28 + 1 month (the same interval) is March, 31.

>    Local system time
>          Local system time is determined by applying the system's time
>          zone offset and year offset values to UTC. The Time of day
>          system value displays the local system time. Local system time
>          and system time are used interchangeably.

"System time" is often used in the sense of hardware clock and 
originated from the times when DOS or Windows required local time.

>    Time Zone
>          A place/region.

Do you consider e.g. Etc/GMT-8 or UTC itself as a time zone?

>    Floating time
>          A wall time value without time zone or offset information. E.g.,
>          2023-01-24 or 6:45pm.

A potential source of confusion with timestamp in seconds since epoch as 
a floating point number, see `float-time'. (info "(elisp) Time of Day") 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-of-Day.html#index-float_002dtime

> Org must first support
> fixed/absolute time instead of just floating time.

Am I wright "in addition" is applicable here in the place of "instead"?

> • Design and implement the time zone aware calendar system This is a
>    separate project.

Will not such decision ruin "every Wednesday at 3:00 PM" at the moment 
of DST transition? I would vote that IANA DB should be used for 
calculations despite I have not seen a library with perfect API. Though 
libc with some tricks may allow to do most of tasks. (Even in presence 
of limitations such as unavailable identifier of system time zone.) This 
is the main point of my disagreement. If real time zones are not 
implemented from the beginning then the will be never supported, so the 
whole bunch of code will be requiring throwing away while keeping 
support of some formats to read old files.

>    • We are able to defer to experts and 35 years of knowledge rather
>      than debate among ourselves

Experts may generate enough pain such as requirement to not support IANA 
timezone DB as it was in EcmaScript 5 (Chrome followed it, but in 
Firefox conversion between local time worked correctly).


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-27 21:04                                                                 ` Tim Cross
@ 2023-01-29  4:09                                                                   ` Jean Louis
  2023-01-29  6:21                                                                     ` Thomas S. Dye
                                                                                       ` (2 more replies)
  0 siblings, 3 replies; 330+ messages in thread
From: Jean Louis @ 2023-01-29  4:09 UTC (permalink / raw)
  To: Tim Cross
  Cc: Sterling Hooten, Thomas S. Dye, Ihor Radchenko, Daryl Manning,
	rjhorn, emacs-orgmode

* Tim Cross <theophilusx@gmail.com> [2023-01-28 00:15]:
> >
> >> What kinds of representations would a calendar system capable of
> >> handling timezones require?
> >> 
> >> • Instant (fixed)
> >>   • This is referring to an unambiguous moment in time
> >>   • e.g., 2007-02-03T05:00:00.000Z
> >> • Offset (fixed)
> >>   • This captures the idea of "when did it happen for the person who
> >>     made the observation"
> >>   • e.g., 2007-02-03T04:00:00.000+01:00
> >
> > Offset is not that fixed, maybe from viewpoint of storage as maybe it
> > is considered fixed in it's representation, but you have to keep in
> > mind that time offset by it's definition is changing itself, suddenly,
> > depending of daylight saving and time zone.
> >
> 
> I think your misinterpreting the intent here. If you specify a timestamp
> with offset, it is fixed.

That is what you say. And I am pointing out to international standard
references.

If you use offset as "fixed" it means such use would not be by
standard, and you would confusing users and programmers who are using
standard for calculations in programs.

> It does not change with daylight savings or any other change in
> rules for a time zone. It does not even specify a time zone.

And while and before making that decision, did you review the standard
that time zone offset is influenced and changed by daylight savings?

It does not specify time zone. But it is derived from time zone, and
is not same from time zone.

Are you aware that time zone offset could have "skipped time" or
"added time" due to daylight savings?

That implies that by using time offset, you would forget daylight
savings which are international standard, and make calculations wrong,
because you started applying own standard in Org.

Time offset does not independently exists without time zone. While you
represent it without time zone, you have to observe time zone first,
before deriving time offset from it.

Read from:
https://en.wikipedia.org/wiki/UTC_offset

,----
| Daylight saving time
| 
| Several regions of the world use daylight saving time (DST) and the
| UTC offset during this season is typically obtained by adding one hour
| to local standard time. Central European Time UTC+01:00 is replaced by
| Central European Summer Time UTC+02:00, and Pacific Standard Time
| UTC−08:00 is replaced by Pacific Daylight Time UTC−07:00.
`----

Maybe you wish to include a new type of time representation, something
like "Org time offset", in that case you are involving Org developers
into even deeper problems, as then with the new type, you are left all
alone to make that thing work. 

That new type of "fixed" time offset, would not be standard, and would
confuse careful users and programmers.

Example:

- time offset would be PST UTC-08:00, for example 12:00 o'clock

- with daylight saving time event (the time when people switch
  clocks), the offset of PST UTC-08:00, would suddenly become
  UTC-07:00, and the time offset would suddenly become 11:00 o'clock
  in that moment

- now is your decision if you will keep counting 12 o'clock in Org,
  thus creating new type of time specific to Org or 11 o'clock as that
  is the international standard.

Time offset will change with daylight savings, and must be thus
derived from time zone.

> While it is true that a specific location may have time zone changes
> or that the offset from UTC might change as a result of daylight
> savings, an offset specified in a times stamp does not change and is
> fixed.  This is one of the limitaiton with using offset.

It is fixed only if you think is fixed when it is written once, and
then you think it is fixed. 

In the sense of calculation of time, it is not fixed and for any
calculation of time offset you need to observe in which time zone is
that time offset, and if you do not know time zone you can't calculate
it correctly.

Please read Wikipedia article explaining it clearly. 

Please read how in China time offset is not every 15 degrees, and how
there is wording "Although nominally" and "every 15 degrees".

Time offset is thus calculated based on time zone and other factors.

It is derived. 

It is not basic time type to be used for other calculations!

It is a difference of time that is mostly in this way, but shaped by
politics in other way.

Time zone is time added or deducted from UTC. But not just added in
mathematical sense, it is added by considering daylight savings, and
time zones and politics.

> I also think it is a mistake (which I've seen others suggest in this
> thread) to equate an offset as being an abbreviation for a time
> zone. 

That is very right. Time offset may be derived from time zone by using
tz database, but it cannot just be automatically derived.

Time offset is not derived from UTC, it is however, derived from tz
database, observing time zones, politics.

> For example, some have suggested things like +10000 being the same
> as AEST and both being abbreviations for Australia/Sydney outside of
> daylight savings periods. I think that is incorrect.

Using time offset for calculations is useless as it lacks the time
zone, and is only one way of representation for those people who do
not understand time zone.

However, time offset is NOT fixed, it is representation based on time
zone, politics, tz database.

Please read carefully here:
https://en.wikipedia.org/wiki/Daylight_saving_time

and search for time offset to find references.

> +1000 is a fixed offset from UTC

To say that it is fixed you will confuse people here. 

When you say "fixed" you must say in which context it has been fixed.

I have given you enough examples in this e-mail to understand that
time offset in the context of programming is not fixed, as programmer
would need to know the time zone, and time offset may be in different
time zones same! 

Thus deriving time zone unambiguously from time offset is not
possible. You could derive some time zones, but not all. In this
context is not fixed.

Deriving UTC time from time offset by using time offset time stamp IS
possible. In that context it is "fixed".

Deriving positive or negative time difference from time offset is not
unambiguously workable! (Unless you make Org new type of time) This is
not workable because time offset does change with daylight saving time
and also by politics. And to know how it change, again you will need
time zone. In this context it is NOT fixed.

Another good reference:
https://dba.stackexchange.com/questions/94841/how-to-check-the-timezone-for-a-given-datetime

Where the main Answer says: 

,----
| a DATETIME value and a Timezone (name) then you can determine the
| Offset by looking up what the Offset was at that point in time (see
| below for sources of such data)
`----

,----
| The "offset" is a property of the timezone, but it does not, and
| cannot, determine the timezone since:
| 
|    - several timezones can share the same offset
|    - timezones can come and go and can even shift their offset
|    - different regions can change their timezones
`----

And then this following, well expressed answer:

,----
| With only the Offset, the DATETIME value can be converted to UTC, but
| not to another Offset without first having a Timezone database and
| knowing which specific Timezone you are converting it to, which will
| indicate the Offset for that particular point in time
`----

Another problem is that several online explanations on Stack-what are
not giving proper explanation. Please be careful when you go searching
various programmers statements on Stack-what websites, as programmer
may make wrong functions in this or that programming language,
thinking:

"Oh, that ain't workin', that's the way you do it"

Conclusion:
-----------

Time offset is offset to/from UTC time, derived from time zone, and is
only fixed for that specific time point. It cannot be used to derive
other offset, or for programming calculations without using time zone.

Time offset is only a different representation of time.

If it is valid representation depends who and how calculated it. But
let us assume good program did so.

When it is properly represented, it cannot be used as "fixed" time to
calculate differences in time as it lacks time zone information, and
because time offset is changing due to daylight savings and political
decisions. 

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-29  4:09                                                                   ` Jean Louis
@ 2023-01-29  6:21                                                                     ` Thomas S. Dye
  2023-01-29  6:46                                                                       ` Daryl Manning
  2023-01-30 19:37                                                                       ` Jean Louis
  2023-01-29  6:31                                                                     ` Max Nikulin
  2023-01-29 20:26                                                                     ` Tim Cross
  2 siblings, 2 replies; 330+ messages in thread
From: Thomas S. Dye @ 2023-01-29  6:21 UTC (permalink / raw)
  To: Jean Louis
  Cc: Tim Cross, Sterling Hooten, Thomas S. Dye, Ihor Radchenko,
	Daryl Manning, rjhorn, emacs-orgmode


Jean Louis <bugs@gnu.support> writes:

> Time offset does not independently exists without time zone. 
> While you
> represent it without time zone, you have to observe time zone 
> first,
> before deriving time offset from it.
>

UTC offset exists without time zone.  UTC is absolute time and 
offsets from it do not refer to political time in a time zone. 
They refer to local *solar time* at a particular place.  

> Read from:
> https://en.wikipedia.org/wiki/UTC_offset
>
> ,----
> | Daylight saving time
> | 
> | Several regions of the world use daylight saving time (DST) 
> and the
> | UTC offset during this season is typically obtained by adding 
> one hour
> | to local standard time. Central European Time UTC+01:00 is 
> replaced by
> | Central European Summer Time UTC+02:00, and Pacific Standard 
> Time
> | UTC−08:00 is replaced by Pacific Daylight Time UTC−07:00.
> `----

Your wikipedia citation puts it like this: "The UTC offset (or 
time offset) is an amount of time subtracted from or added to 
Coordinated Universal Time (UTC) time to specify the local solar 
time (which may not be the current civil time, whether it is 
standard time or daylight saving time)."

Note that the quote distinguishes UTC offset from standard time 
and daylight saving time, which refer to time zones.

This distinction between absolute time (solar time) and space/time 
(time zone) is fundamental. Confusing them leads to no good.

hth,
Tom

-- 
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-29  4:09                                                                   ` Jean Louis
  2023-01-29  6:21                                                                     ` Thomas S. Dye
@ 2023-01-29  6:31                                                                     ` Max Nikulin
  2023-01-30 20:36                                                                       ` Jean Louis
  2023-01-30 20:38                                                                       ` Jean Louis
  2023-01-29 20:26                                                                     ` Tim Cross
  2 siblings, 2 replies; 330+ messages in thread
From: Max Nikulin @ 2023-01-29  6:31 UTC (permalink / raw)
  To: emacs-orgmode

On 29/01/2023 11:09, Jean Louis wrote:
> * Tim Cross [2023-01-28 00:15]:
>>>> • Offset (fixed)
>>>>    • This captures the idea of "when did it happen for the person who
------------------------------------^^^^^^^^^^^^^^^^^^^
Jean, you missed it.

>>>>      made the observation"
>>>>    • e.g., 2007-02-03T04:00:00.000+01:00
>>>
>>> Offset is not that fixed, maybe from viewpoint of storage as maybe it
...
>> I think your misinterpreting the intent here. If you specify a timestamp
>> with offset, it is fixed.
> 
> That is what you say. And I am pointing out to international standard
> references.

You reference and verbose message are hardly relevant. Since something 
has already happened, time offset is known. DST can not change it, 
either it is effective or not at this moment.

2007-02-03T04:00:00.000+01:00

can not be unambiguously attributed to an IANA timezone ID, however it 
precisely specifies UTC time (time in seconds since epoch, etc.).

Usually (but not necessary) it means 04:00 local time in a timezone 1 
hour ahead of UTC that moment (you may use it to specify 05:00 in 
timezone having +02:00 offset). It is enough for a lot of applications.

There are important enough reasons to consider (and maybe discard to 
still use offset) IANA timezone ID for scheduling an event in future. 
Both options should be possible.



^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-29  6:21                                                                     ` Thomas S. Dye
@ 2023-01-29  6:46                                                                       ` Daryl Manning
  2023-01-29 14:10                                                                         ` Ihor Radchenko
  2023-01-30 19:37                                                                       ` Jean Louis
  1 sibling, 1 reply; 330+ messages in thread
From: Daryl Manning @ 2023-01-29  6:46 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1990 bytes --]

All these discussions are really great, devil is in the details and all,
but is anyone working on implementation code for this? It’s tricky to have
visibility on WIP on org-mode - probs just me not knowing where to look tbh
(but big believer that working code is progress… 😊)

Daryl.

On Sun, 29 Jan 2023 at 13:36, Thomas S. Dye <tsd@tsdye.online> wrote:

>
> Jean Louis <bugs@gnu.support> writes:
>
> > Time offset does not independently exists without time zone.
> > While you
> > represent it without time zone, you have to observe time zone
> > first,
> > before deriving time offset from it.
> >
>
> UTC offset exists without time zone.  UTC is absolute time and
> offsets from it do not refer to political time in a time zone.
> They refer to local *solar time* at a particular place.
>
> > Read from:
> > https://en.wikipedia.org/wiki/UTC_offset
> >
> > ,----
> > | Daylight saving time
> > |
> > | Several regions of the world use daylight saving time (DST)
> > and the
> > | UTC offset during this season is typically obtained by adding
> > one hour
> > | to local standard time. Central European Time UTC+01:00 is
> > replaced by
> > | Central European Summer Time UTC+02:00, and Pacific Standard
> > Time
> > | UTC−08:00 is replaced by Pacific Daylight Time UTC−07:00.
> > `----
>
> Your wikipedia citation puts it like this: "The UTC offset (or
> time offset) is an amount of time subtracted from or added to
> Coordinated Universal Time (UTC) time to specify the local solar
> time (which may not be the current civil time, whether it is
> standard time or daylight saving time)."
>
> Note that the quote distinguishes UTC offset from standard time
> and daylight saving time, which refer to time zones.
>
> This distinction between absolute time (solar time) and space/time
> (time zone) is fundamental. Confusing them leads to no good.
>
> hth,
> Tom
>
> --
> Thomas S. Dye
> https://tsdye.online/tsdye
>

[-- Attachment #2: Type: text/html, Size: 2687 bytes --]

^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-29  6:46                                                                       ` Daryl Manning
@ 2023-01-29 14:10                                                                         ` Ihor Radchenko
  0 siblings, 0 replies; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-29 14:10 UTC (permalink / raw)
  To: Daryl Manning; +Cc: Thomas S. Dye, emacs-orgmode

Daryl Manning <daryl@wakatara.com> writes:

> All these discussions are really great, devil is in the details and all,
> but is anyone working on implementation code for this? It’s tricky to have
> visibility on WIP on org-mode - probs just me not knowing where to look tbh
> (but big believer that working code is progress… 😊)

No WIP yet.
The purpose of the ongoing discussion is figuring out the pitfalls to
not fall into. We do not want to start writing code just to find out
that it has to be completely scraped because we did not account to some
important details.

We do not even know yet what will be the timestamp format with
timezones.

Once we know the format, we can slowly work through Org functions to
support the timezone info in the timestamps.

Later, we will need to implement the necessary new features for TZ
support in agenda/calendar/input prompts.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-29  4:09                                                                   ` Jean Louis
  2023-01-29  6:21                                                                     ` Thomas S. Dye
  2023-01-29  6:31                                                                     ` Max Nikulin
@ 2023-01-29 20:26                                                                     ` Tim Cross
  2023-01-30 20:55                                                                       ` Jean Louis
  2 siblings, 1 reply; 330+ messages in thread
From: Tim Cross @ 2023-01-29 20:26 UTC (permalink / raw)
  To: Jean Louis
  Cc: Sterling Hooten, Thomas S. Dye, Ihor Radchenko, Daryl Manning,
	rjhorn, emacs-orgmode

Jean Louis <bugs@gnu.support> writes:

> * Tim Cross <theophilusx@gmail.com> [2023-01-28 00:15]:
>> >
>> >> What kinds of representations would a calendar system capable of
>> >> handling timezones require?
>> >> 
>> >> • Instant (fixed)
>> >>   • This is referring to an unambiguous moment in time
>> >>   • e.g., 2007-02-03T05:00:00.000Z
>> >> • Offset (fixed)
>> >>   • This captures the idea of "when did it happen for the person who
>> >>     made the observation"
>> >>   • e.g., 2007-02-03T04:00:00.000+01:00
>> >
>> > Offset is not that fixed, maybe from viewpoint of storage as maybe it
>> > is considered fixed in it's representation, but you have to keep in
>> > mind that time offset by it's definition is changing itself, suddenly,
>> > depending of daylight saving and time zone.
>> >
>> 
>> I think your misinterpreting the intent here. If you specify a timestamp
>> with offset, it is fixed.
>
> That is what you say. And I am pointing out to international standard
> references.
>
> If you use offset as "fixed" it means such use would not be by
> standard, and you would confusing users and programmers who are using
> standard for calculations in programs.
>
>> It does not change with daylight savings or any other change in
>> rules for a time zone. It does not even specify a time zone.
>
> And while and before making that decision, did you review the standard
> that time zone offset is influenced and changed by daylight savings?
>
> It does not specify time zone. But it is derived from time zone, and
> is not same from time zone.
>
> Are you aware that time zone offset could have "skipped time" or
> "added time" due to daylight savings?
>
> That implies that by using time offset, you would forget daylight
> savings which are international standard, and make calculations wrong,
> because you started applying own standard in Org.
>

I think your still misunderstanding what is meant by offset.

Yes, a timezone is defined by the offset it has from UTC
Yes, a location time zone may change due to various reasons, such as
daylight savings time, which also means the offset for that timezone
changes. However, it is the time zone definition which has
changed. THink of it as a time zone with a new offset rather than a time
zone with a chagned offset. 

When you specify a date+time wiht an explicit offset, that offset is
fixed. That date+time is fixed. It will not change when daylight davings
comes in or goes out because it isn't a time zone. It is only an offset
and has no location reference and therefore no time zone.

Saying that an offset is a fixed value is very different from saying
that a time zone has a fixed offset. I think this is where your
confusion is coming from. 


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: Org mode timestamps on the Moon ; ] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)
  2023-01-26 23:40       ` Org mode timestamps on the Moon ;] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Tom Gillespie
@ 2023-01-30 10:13         ` Greg Minshall
  2023-01-30 13:05         ` Org mode timestamps on the Moon ;] " Ihor Radchenko
  1 sibling, 0 replies; 330+ messages in thread
From: Greg Minshall @ 2023-01-30 10:13 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: Org-mode

Tom,

> The only generalized solution is to record the full location (see
> intro to http://naggum.no/lugm-time.html which I'm surprised hasn't
> been linked in this thread yet, ...

very nice -- thanks for the pointer!

cheers, Greg


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-27 11:09                                                               ` Ihor Radchenko
  2023-01-27 12:49                                                                 ` Sterling Hooten
  2023-01-27 20:58                                                                 ` Tim Cross
@ 2023-01-30 11:25                                                                 ` Greg Minshall
  2023-01-31 11:48                                                                   ` [POLL] Proposed syntax for timestamps with time zone info (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda) Ihor Radchenko
  2 siblings, 1 reply; 330+ messages in thread
From: Greg Minshall @ 2023-01-30 11:25 UTC (permalink / raw)
  To: Ihor Radchenko
  Cc: Sterling Hooten, Thomas S. Dye, Tim Cross, Jean Louis,
	Daryl Manning, rjhorn, emacs-orgmode

Ihor, Sterling, et al.,

just a thought/reminder.  there are "semantics" and "encoding".  a spec
like ISO-8601 specifies both.  the important thing for org-mode is to
use an encoding that

1. is easily parsable/understandable by the mere mortal

2. allows expression of all the semantics of the underlying spec/specs
   (be that ISO-8601, this new IETF spec, the Library of Congress spec,
   etc.)

3. and, importantly, is designed to *try* to follow updates to the
   underlying spec/specs (which will inevitably happen)

in my experience, it is easiest to accomplish 2 and 3 by adopting the
encoding in the underlying spec/specs (if "specs" -- hopefully they are
compatible! :)

but, i don't doubt that other encodings that accomplish 1, and still
accomplish 2 and 3, exist.

possibly, an important step forward is to complete the sentence,
"Org-mode datestamps are intended to conform to the semantics (but not
necessarily the encoding) specified in the following specifications:
...".

cheers, Greg


^ permalink raw reply	[flat|nested] 330+ messages in thread

* Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
  2023-01-27  6:06                                                             ` Sterling Hooten
                                                                                 ` (2 preceding siblings ...)
  2023-01-27 11:09                                                               ` Ihor Radchenko
@ 2023-01-30 12:30                                                               ` Ihor Radchenko
  2023-01-30 15:30                                                                 ` Greg Minshall
  3 siblings, 1 reply; 330+ messages in thread
From: Ihor Radchenko @ 2023-01-30 12:30 UTC (permalink / raw)
  To: Sterling Hooten
  Cc: Thomas S. Dye, Tim Cross, Jean Louis, Daryl Manning, rjhorn,
	emacs-orgmode

Sterling Hooten <hooten@gmail.com> writes:

> This is an initial glossary compiled from various standards and sources;
> it's incomplete, probably incorrect, and open to critique, but is useful
> in articulating a possible road map forward.

Do I understand correctly that the terms are simply taken from ISO (https://www.iso.org/obp/ui/#iso:std:iso:8601:-1:ed-1:v1:en)? 

> What does format does Org have now?
>
> • The format currently in use for timestamps is floating, field-based,
>   and has a resolution/precision of minutes.
>
> What kinds of representations would a calendar system capable of
> handling timezones require?
>
> • Instant (fixed)
>   • This is referring to an unambiguous moment in time
>   • e.g., 2007-02-03T05:00:00.000Z
> • Offset (fixed)
>   • This captures the idea of "when did it happen for the person who
>     made the observation"
>   • e.g., 2007-02-03T04:00:00.000+01:00
> • Instant with explicit offset and zone (fixed)
>   • e.g., 2007-01-01T02:00:00.000+01:00[America/Chicago]
> • Zoned local date time (floating)
>   • Tricky, requires decisions about how to interpret timestamps after
>     political changes.
>   • e.g., 2007-01-01T01:00:00.000[America/Chicago]

Note that representing the time zone does not require second/sub-second
precision. Let's not complicate the matters.

Also, [time zone] is not compatible with Org's delimiting syntax. We
need to come up with something else.

> What would a roadmap be?
>
> • Design and implement an absolute and offset timestamp system
>   • Decide on a time scale

UTC. Because we are bound by capabilities of Emacs time API.

>   • Decide on a format and syntax

Sure.

>   • Implement instant timestamps
>   • Implement offeset timestamps

This is all available via Emacs time API as implemented in glibc.
Time db is supported. Time zone names are supported. Fixed offsets are
also supported via TZ POSIX standard
(https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html).

> • Design and implement the time zone aware calendar system This is a
>   separate project.

Org support for time zones is exactly the calendar system you are
talking about. This will be most of the work TBD.

> What format and syntax should Org use?
>
> A heretical suggestion: We should abandon the day of week abbreviation
> and use a new format.

As you saw from a number of replies, people do find week abbreviation
useful.

> The current format generates a three leter abbreviation of the day of
> the week [2023-01-25 Wed 12:12]. I suggest supporting this as a
> legacy/simple format but switch to a format/encoding like
> [2023-01-25T15:13:42Z] for the new system. Specifically I'm advocating
> for an extended ISO 8601 format, compatible with expanded dates and
> Level 2 of the EDTF, with some (bracket?) notation surrounding it such
> that Org can parse the syntax as a timestamp. I advocate further for the
> use of durations and repeating intervals to follow the same standard
> format. Thus instead of a range being formatted as:
>
> [2023-01-25 Wed 13:57]–[2023-01-26 Thu 13:57]
>
> it would be:
>
> [2023-01-25T16:57:42Z/2023-01-26T16:57:42Z].

As I (and others) replied, we will not do it. We aim for human-readable
representation. Hence, while we can draw ideas from EDTF and ISO, we
will not follow them precisely.

> If the square bracket delimiter syntax is insufficient or too difficult
> to parse unambiguously, we could just encapsulate the ISO format in a
> sub-syntax (e.g., [&&(ISO format)] similar to the [%%(diary sexp)]
> technique). This is ugly, but perhaps a stepping stone during
> development to separate syntax parsing concerns from calculating etc.

This would be a breaking change that will force all the libraries adapt.
If we need supporting raw ISO syntax at any point, it can be simply made
a subset of [%%(diary sexp)]. At the end, diary sexps are nothing but
Elisp functions. We don't need to invent yet another syntax for ISO.

> What are the advantages of switching to a standard format for the new
> system?
> ...
> • We have a way of distinguishing new timestamps from legacy/simple ones
>   By making a change in syntax we reduce (or eliminate?) the possibility
>   of ambiguity between "which version" of a timestamp is being parsed. A
>   legacy timestamp can be treated as such, and new timestamps are easily
>   identified by the 'T' present instead of spaces, or in the delimiters
>   wrapping the representation.

We should not introduce this problem to start with. The versions should
be mutually compatible if at all possible. Note, for example, that
<2023-01-30 Mon 14:00 @Europe/Berlin> does not even break the existing
Org versions, except that time zone part is ignored.

I am strongly against introducing a brand-new timestamp syntax and
abandoning (or maintaining infinitely) the current one.

Proliferation of multiple parallel syntax variants is something we
really want to avoid maintenance-wise.

> • We free ourselves from the constraints of the legacy timestamp format
>   Trying to engineer a new syntax which also parses as an extension of
>   the legacy one is more complex and embeds things like "day of the
>   week" and the use of spaces as separators into this new system. Easier
>   to have two side by side.

This should only be the last resort. We are not quite there.

> • We can defer to existing parsing and calculating systems There are
>   already programs written which support the ISO standard and EDTF.

No. We can only defer the existing parsing to Elisp time API. Which does
not support EDTF. And supporting approximate dates from EDTF would be
hard to implement anyway - do we really need those?

>   • We can directly (or nearly directly) import the regular expressions
>     and parsing mechanisms already written.

It's not like these regular expressions are particularly complex. And we
are not going to make them complex either way.

>   • These enable decent testing suites as we build the system, as we can
>     check against existing packages to see if our parsing and
>     calculations agree.

Or we can write a simple converter from Org syntax to ISO and do the
same. Though I do not know any existing testing suite we could utilize
here.

>   • Users who wish to use external libraries (irrespective of language
>     or license) can extract the new timestamp and parse or calculate
>     externally.

I would not be so dramatic here. We do provide syntax description in
https://orgmode.org/worg/org-syntax.html#Timestamps It is not a big deal
to follow it.

> • Org is part of a standard
>   • We are able to defer to experts and 35 years of knowledge rather
>     than debate among ourselves

How so?

>   • Interfacing with other programs is simplified as the area inside the
>     delimiter notation can be passed as a string without parsing.

No. Org is not context-free. Parsing will be required anyway.

>   • New users and collaborators can be onboarded faster without needing
>     to learn a new system

Is it really so much decisive factor? I doubt so.

>   • Org documentation can refer to the standard instead of bearing the
>     burden of exposition.

That's a plus. But not decisive one.

> • The move to include time zones in the format is simplified
>   • The ISO standard has recently adopted a format for time zones from
>     RFC3339 and JAVAZDT, we can adhere to 8601 and keep things
>     consistent.

We have to follow POSIX TZ anyway. Maybe with minor additions.

> What other perspectives should the new format support?
>
> In addition to the representations necessary for a timezone aware
> calendar system, I suggest the new format be compatible with two other
> representations: finer/ arbitrary resolution for scientific work, and
> Level 2 of the Extended Date/Time Format for bibliographic and metadata
> systems.

Please frame it as a separate proposal. We have enough complexities with
time zones to add this on top.

> The Extended Data/Time Format (EDTF) was designed by the Library of
> Congress to address limitations of the ISO standard for metadata and
> archival purposes. A draft specification was created in 2012 and EDTF
> functionality has now been integrated into ISO 8601-2019. Of great
> interest is the ability to express the concepts of un