emacs-orgmode
[Top][All Lists]
Advanced

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

Re: org-table change time from UTC to other timezones


From: Jean Louis
Subject: Re: org-table change time from UTC to other timezones
Date: Sat, 12 Dec 2020 06:31:06 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* Maxim Nikulin <manikulin@gmail.com> [2020-12-11 18:45]:
> 2020-12-11 Alan E. Davis wrote:
> > 
> > I had hoped that subtracting 10 hours from 06:44 UTC would get me at
> > least -04:44.
> 
> I am in doubts how to present negative time correctly. Having in mind wall
> clocks with hands, your expectation has some sense.
> 
> I think, the source of confusion is that you are trying to use facilities
> intended for TimeInterval + TimeInterval arithmetic, where TimeInterval
> denotes a type. Actually you need to compute Time + TimeInterval. Sorry, I
> am unaware if Emacs provides proper functions.
> 
> There are a lot of subtle issues with time-related operations, but most of
> DST complications pointed out by Tim could be handled with IANA (Olson) DB
> for time zones, on Linux it is almost always installed as tzdata package and
> is getting regular updates. It is rather precise and contains history of DST
> and other transitions. If people complains on incorrect results, usually
> they have wrong timezone set on their computers.
> 
> For astronomy the best representation should be timestamp (seconds since
> epoch) converted to local date time when necessary. Unsure concerning leap
> seconds.
> 
> Human-related future events mostly should be stored as date + local time +
> label of administrative region that allows to get time zone ID (namely ID,
> not offset from UTC). Time offset could be changed after event has been
> planned, time zone could be split into several ones with distinct offsets.
> 
> - LocalTime + TimeInterval operation could give incorrect result unless
> LocalTime is augmented with date and TimeZone, the latter is the history of
> transitions.
> - TimeZone (e.g. Europe/Berlin) as full transition history is not the same
> as TimeOffset at particular moment (+0100).

Let me just comment that PostgreSQL database has date/time types such
as:

TIMESTAMP WITHOUT TIME ZONE and
TIMESTAMP WITH TIME ZONE

but all of them are stored without time zone, the difference being
that "WITH TIME ZONE" would only be displayed with specific time
zone.

Same approach can be used in other time storages, just store it as
UTC, display it as you wish.

Jean



reply via email to

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