emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [POLL] Proposed syntax for timestamps with time zone info (was: [FEA


From: Max Nikulin
Subject: Re: [POLL] Proposed syntax for timestamps with time zone info (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)
Date: Mon, 6 Feb 2023 00:04:27 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 05/02/2023 01:59, ypuntot wrote:
Then, given the time zone and the local time, you can know UTC.
If orgmode gets the UTC there is not ambiguity.

Mapping from local time to UTC may be ambiguous, so mapping from local time to time zone offset may be ambiguous as well.

The extreme case is 1892-07-04 that happened twice in Pacific/Apia due to offset change by 24 hours to another side of International Date Line. Due to the opposite transition there was no 2011-12-30 in this time zone.

Usual case is local time change due to daylight saving time. Notice that 2nd and 4th lines in the results table have the same input, but time offset differs by 1 hour in the output while local time is the same:

#+header: :var tz="Europe/Berlin"
#+header: :var t0='(:year 2023 :month 10 :day 29 :hour 2 :minute 30 :second 0)
#+header: :var hours='(1 2 3 2)
#+begin_src elisp
  (mapcar
   (lambda (h)
     (let ((dt (apply #'make-decoded-time :zone tz :dst -1 t0)))
       (setf (decoded-time-hour dt) h)
       (list dt
             (format-time-string "%F %a %T @%z" (encode-time dt) tz))))
   hours)
#+end_src

#+RESULTS:
| (0 30 1 29 10 2023 nil -1 Europe/Berlin) | 2023-10-29 Sun 01:30:00 @+0200 | | (0 30 2 29 10 2023 nil -1 Europe/Berlin) | 2023-10-29 Sun 02:30:00 @+0200 | | (0 30 3 29 10 2023 nil -1 Europe/Berlin) | 2023-10-29 Sun 03:30:00 @+0100 | | (0 30 2 29 10 2023 nil -1 Europe/Berlin) | 2023-10-29 Sun 02:30:00 @+0100 |

P.S.

https://zachholman.com/talk/utc-is-enough-for-everyone-right
https://www.youtube.com/watch?v=aEvB98CstOk
UTC is Enough for Everyone, Right?

Zach, whatever you do: just don't ever build a calendar





reply via email to

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