emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Two problems with export to Google calendar


From: Ihor Radchenko
Subject: Re: Two problems with export to Google calendar
Date: Mon, 12 Dec 2022 14:00:18 +0000

Max Nikulin <manikulin@gmail.com> writes:

>> By default, ox-icalendar takes the value of your TZ environment variable.
>
> I think, in most cases TZ is not set, so (format-time-string "%Z") is 
> used to get abbreviation (that is ambiguous).
>
> On Linux we may try
>
>      timedatectl show --property=Timezone --value
>
> during generation of export template. There is a chance that init system 
> is not systemd, so the command is not available. It is possible to get 
> timezone from /etc/timezone, but the code would not concise since it may 
> be a text file or a symlink to the definition. I have no idea concerning 
> macOS or Windows.

According to POSIX standard
(https://pubs.opengroup.org/onlinepubs/9699919799/), we need to use "TZ"
environment variable, when present. Otherwise, fallback to defaults.

This is exactly what ox-icalendar does. If TZ is set, use it. Otherwise,
use `current-time-zone'.

> Emacs relies on libc to handle time zones, and there is no API to get 
> the identifier. I miss the option available in modern browser JavaScript
>
>      new Intl.DateTimeFormat().resolvedOptions().timeZone

The issue in this bug report is that TZ is actually set. Ambiguously. In
OS. We cannot do much about it. Outsmarting system settings is not a
good idea.

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