From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WJilI8U61F8BRAAA0tVLHw (envelope-from ) for ; Sat, 12 Dec 2020 03:36:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id uN9wH8U61F8EHgAAB5/wlQ (envelope-from ) for ; Sat, 12 Dec 2020 03:36:37 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1B2289402B0 for ; Sat, 12 Dec 2020 03:36:37 +0000 (UTC) Received: from localhost ([::1]:59302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knvhy-0001VH-Uh for larch@yhetil.org; Fri, 11 Dec 2020 22:36:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knvhC-0001T0-V9 for emacs-orgmode@gnu.org; Fri, 11 Dec 2020 22:35:46 -0500 Received: from stw1.rcdrun.com ([217.170.207.13]:59123) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knvh9-0006DP-Lc for emacs-orgmode@gnu.org; Fri, 11 Dec 2020 22:35:46 -0500 Received: from localhost ([::ffff:41.202.241.42]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000002935DC.000000005FD43A8C.000004A9; Fri, 11 Dec 2020 20:35:40 -0700 Date: Sat, 12 Dec 2020 06:31:06 +0300 From: Jean Louis To: Maxim Nikulin Subject: Re: org-table change time from UTC to other timezones Message-ID: References: <87wnxrjjl2.fsf@gmail.com> <87lfe5ju0t.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.80 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 1B2289402B0 X-Spam-Score: -1.80 X-Migadu-Scanner: scn1.migadu.com X-TUID: vSj1JxlR5cUW * Maxim Nikulin [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