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

Re: Local time in databases (Re: ntpsec as server questions)



On Fri, Dec 08, 2023 at 09:11:12AM +0700, Max Nikulin wrote:
> On 07/12/2023 23:08, tomas wrote:
> > On Thu, Dec 07, 2023 at 10:29:29PM +0700, Max Nikulin wrote:
> > > On 07/12/2023 21:22, John Hasler wrote:
> > > > Databases should never store local time.
> > > 
> > > There are exceptions when storing UTC instead of local time leads to
> > > undesired consequences.
> > 
> > Heh. There was one huge thread in Emacs user about a year ago (don't
> > ask me in which time zone).
> 
> Perhaps you mean emacs-ormode.

Right, that was it. I envy your memory :-)

> Then an important difference arises.
> Timestamp are stored not in a database, but in a plain text file and must be
> human readable, moreover some users prefer to type timestamps directly
> without dedicated commands.

The difference is there, but basically, it's minor.

> Leaving aside future timestamps that may need local time, significant
> fraction of timestamps may be reliably represented in UTC. I still have no
> clue why some people were strongly against local time with explicit time
> offset "2023-12-07 17:08:50 +0100". From my point of view such format may be
> unambiguously mapped to UTC "2023-12-07T16:08:50Z" and more convenient for
> users residing in Europe/Berlin. There were participants insisting on either
> forcing UTC or using IANA identifiers "2023-12-07 17:08:50 Europe/Berlin".
> The latter format has issues close to backward DST time shifts and should be
> augmented with disambiguation hints.

100% agreement. Perhaps *both* is best: the time zone (to keep "intention")
and the offset (to keep "actual time"). If I could go backwards in time
(heh ;-), that's what I would have talked that customer into.

[...]

> Local time is widely used in logs. The question is if the client can accept
> ambiguity

This was an industrial application logging measurements from machines all
over the place (and to different log files), so if a shed went up in flames,
you'd be comparing different logs to each other to try to find out what
went wrong.

So no, IMO not in that case. It took me days of talking :-)

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature


Reply to: