emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-ag


From: Ihor Radchenko
Subject: Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda
Date: Sat, 21 Jan 2023 09:21:19 +0000

"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>



reply via email to

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