From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EFTXD5TY0V+EOwAA0tVLHw (envelope-from ) for ; Thu, 10 Dec 2020 08:13:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id uGCVC5TY0V8uCAAAbx9fmQ (envelope-from ) for ; Thu, 10 Dec 2020 08:13:08 +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 9907D94043A for ; Thu, 10 Dec 2020 08:13:07 +0000 (UTC) Received: from localhost ([::1]:36972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knH4T-0001n7-6f for larch@yhetil.org; Thu, 10 Dec 2020 03:13:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knH2u-0001mb-S7 for emacs-orgmode@gnu.org; Thu, 10 Dec 2020 03:11:28 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:38296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1knH2s-0000Ks-UJ for emacs-orgmode@gnu.org; Thu, 10 Dec 2020 03:11:28 -0500 Received: by mail-wm1-x332.google.com with SMTP id g185so4313957wmf.3 for ; Thu, 10 Dec 2020 00:11:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cpsyrQvYe3KDjUn6Qwnz9ew5x6GNIUyzW2l2kEkza8A=; b=BKTDdGe4zBTZNeagybxAbRDo2EzC46uMggKTGPKFn3uU273DW9J/b14dn70JEQeFsW bZD00q6y7gAJHAFByB4ynuAYtQhX+IXUCEzM2TWmqKYuhVeoes6n4SFZcaMfAd89pvyG cx11kNnwG0ezps267jaic66edGQop0WhATIiTBjL2AXHEZ+yw/LydPb5IcKgQThBW+J6 ac9mFTuQ/3FQAfO0jsUm4gulXePAKKC5PXH9zPzX24RGVdbNUNzS+NJW1/SXSysnPBZx 9j5FAQ15vhqUvKhNh/Txy2ylPM9ftQCVuRSXuF0eTBzYJO0Rh8dEKQvlOh8W8/E2VKPN Rrfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cpsyrQvYe3KDjUn6Qwnz9ew5x6GNIUyzW2l2kEkza8A=; b=tZgyYnNJGIeEsW9SQUjQlzUFtj6KslwOSPtpWAz3/UICy6KBoXNw3JDls0MGymKXJW KSWNjrH+Wp/PIFhj1b0dRAKMcU96pY9r11sQwyd697GUe0SaXHeF8X9VF6GkFxvnb8qZ UAXJVSUZdBJD805qqLEG43pWLsAWVTNHYMx7EBQYX11+OQakY6r/6o1S50SGzXbdorVc 6OoAMZt/GBzM86ZMcRvoAmu9ZldnGXCigMSMXoe4d66Hr9iixDu8NpucfrswStphTE8e 9VJ0bnWYhfZPFZEAShkxTd274RWt0Fl91BrRKkn1CQT9sTbhc7ZmHJAFlimQkPud3WAF F+YQ== X-Gm-Message-State: AOAM533OxeS1EDBT12oIDcccktY27MC8THiTwexAKt/O+bTN8gbAtsmo hQDim64SZCxk53RuEsYeRaiPI9NX4TZ1RjLf/IQ= X-Google-Smtp-Source: ABdhPJwb4Ir12deFrS9oWsd6/tysMVBsJYWXByQf+B+3r50sXuynMRaS76G1DQ1/6ewHWowFAVU1ykueWKdy7FoA0z0= X-Received: by 2002:a1c:35c2:: with SMTP id c185mr6883073wma.74.1607587883166; Thu, 10 Dec 2020 00:11:23 -0800 (PST) MIME-Version: 1.0 References: <87wnxrjjl2.fsf@gmail.com> In-Reply-To: <87wnxrjjl2.fsf@gmail.com> From: "Alan E. Davis" Date: Thu, 10 Dec 2020 00:10:43 -0800 Message-ID: Subject: Re: org-table change time from UTC to other timezones To: Tim Cross Content-Type: multipart/alternative; boundary="000000000000b8b10905b617b8fb" Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=lngndvs@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FROM_LOCAL_NOVOWEL=0.5, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=0.341, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_DOTEDU=1.999 autolearn=no 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: org-mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.50 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=BKTDdGe4; dmarc=pass (policy=none) header.from=gmail.com; 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: 9907D94043A X-Spam-Score: -1.50 X-Migadu-Scanner: scn1.migadu.com X-TUID: NLjwt3SgGtLt --000000000000b8b10905b617b8fb Content-Type: text/plain; charset="UTF-8" I am close to throwing in the towel. Thank you for the suggestion. Several problems have been encountered. I wonder whether I understand this tool at all. If I subtract 10:00 from 08:46, the answer given is -01:14. I used #+TBLFM: $6=$4+$5;U, as follows (please forgive the formatting): | Phenom | Date | DoW | UTC | Hrs | ChST | | |--------+--------+-----+-------+--------+--------+---| | ApoG | 22 | Fr | 06:44 | -10:00 | -03:16 | | |--------+--------+-----+-------+--------+--------+---| #+TBLFM: $6=$4+$5;U When I add 10:00, I think the values are sensible: 21:45 + 10:00 = 31:45. Another problem was in trying to use an inactive org timestamp. It was not straightforward to add or subtract N hours (say, 08:00). This it a thornier problem than I had envisioned, anyway, because in locale with time zones, the conversion factor will change at some point DURING the month. Perhaps there is a calc procedure to convert time zones that will take into account the system's knowledge of the timezones as well as changes to/from Daylight Time. For now, On Wed, Dec 9, 2020 at 3:40 AM Tim Cross wrote: > > Alan E. Davis writes: > > > I have been pleased to learn that I can add / subtract hours in org-table > > to shift time zones. I am making tables of lunar/solar parameters > > relevant to tides. Org-table is a convenient way to enter data in a > > tabular format that can be printed via LaTeX. So each year, for several > > time zones, I enter these times by hand. > > > > It's very, very easy, I have learned, to collect all of these times (at > > most, maybe 12 per month) for UTC, and add or subtract to generate a > column > > of times for a new time zone. Very Slick! > > > > Except that when I add, for example. 09:00 to 23:33, I guess it is pretty > > obvious what is going to happen: it would be the same day, but at 32:33 > !! > > > > I have tripped up on trying to test for whether the sum is greater than > or > > equal to 24:00, and then doing something interesting with it. It's > > actually pretty easy to go through all the months and find the > exceptions, > > and make manual changes. But, as I usually have done, I would rather > spend > > a few hours coming up with some programmatic method for making this work > > automatically! > > > > The other problem is the change of the day. I suppose I could use 0, 1, > > 2... for Sunday, Monday, Tuesday... (I am living in the United States). > > > > Has someone solved this problem? > > > > Org tables support formulas which use the Emacs 'calc' program. Calc has > pretty good support for adding, subtracting, multiplying and otherwise > manipulating dates and times (this is how the org clocktable works). It > should be pretty straight forward to have a column of date + time > values, a time offset representing a timezone and a 3rd column which is > the new date/time after applying the offset. Have a look at the secton > in the org manual on table formulas and the calc manual in info. > > -- > Tim Cross > > -- "This ignorance about the limits of the earth's ability to absorb pollutants should be reason enough for caution in the release of polluting substances." ---Meadows et al. 1972. Limits to Growth . (p. 81) --000000000000b8b10905b617b8fb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I am close to throwing in the towel.=C2=A0
=

Thank you for the suggestion.=C2=A0 Several problems ha= ve been encountered.=C2=A0 I wonder whether I understand this tool at all.= =C2=A0=C2=A0 If I subtract 10:00 from 08:46, the answer given is -01:14.=C2= =A0 I used #+TBLFM: $6=3D$4+$5;U, as follows (please forgive the formatting= ):

| Phenom | =C2=A0 Date | DoW | =C2=A0 UTC | = =C2=A0 =C2=A0Hrs | =C2=A0 ChST | =C2=A0 |
|--------+--------+-----+--= -----+--------+--------+---|
| ApoG =C2=A0 | =C2=A0 =C2=A0 22 | Fr = =C2=A0| 06:44 | -10:00 | -03:16 | =C2=A0 |
|--------+--------+= -----+-------+--------+--------+---|
=C2=A0 =C2=A0 =C2=A0 #+TBLFM: $6=3D= $4+$5;U

When I add 10:00, I think the values a= re sensible: 21:45 + 10:00 =3D 31:45.=C2=A0

A= nother problem was in trying to use an inactive org timestamp.=C2=A0 It was= not straightforward to add or subtract N hours (say, 08:00).=C2=A0=C2=A0 <= br>

This it a thornier problem than I had envision= ed, anyway, because in locale with time zones, the conversion factor will c= hange at some point DURING the month.=C2=A0

P= erhaps there is a calc procedure to convert time zones that will take into = account the system's knowledge of the timezones as well as changes to/f= rom Daylight Time.=C2=A0

For now,
<= /div>
O= n Wed, Dec 9, 2020 at 3:40 AM Tim Cross <theophilusx@gmail.com> wrote:

Alan E. Davis <ln= gndvs@gmail.com> writes:

> I have been pleased to learn that I can add / subtract hours in org-ta= ble
> to shift time zones.=C2=A0 I am making tables of=C2=A0 lunar/solar par= ameters
> relevant to tides.=C2=A0 Org-table is a convenient way to enter data i= n a
> tabular format that can be printed via LaTeX.=C2=A0 So each year, for = several
> time zones, I enter these times by hand.
>
> It's very, very easy, I have learned, to collect all of these time= s (at
> most, maybe 12 per month) for UTC, and add or subtract to generate a c= olumn
> of times for a new time zone.=C2=A0 Very Slick!
>
> Except that when I add, for example. 09:00 to 23:33, I guess it is pre= tty
> obvious what is going to happen: it would be the same day, but at 32:3= 3 !!
>
> I have tripped up on trying to test for whether the sum is greater tha= n or
> equal to 24:00, and then doing something interesting with it.=C2=A0 It= 's
> actually pretty easy to go through all the months and find the excepti= ons,
> and make manual changes.=C2=A0 But, as I usually have done, I would ra= ther spend
> a few hours coming up with some programmatic method for making this wo= rk
> automatically!
>
> The other problem is the change of the day.=C2=A0 I suppose I could us= e 0, 1,
> 2... for Sunday, Monday, Tuesday...=C2=A0 (I am living in the United S= tates).
>
> Has someone solved this problem?
>

Org tables support formulas which use the Emacs 'calc' program. Cal= c has
pretty good support for adding, subtracting, multiplying and otherwise
manipulating dates and times (this is how the org clocktable works). It
should be pretty straight forward to have a column of date + time
values, a time offset representing a timezone and a 3rd column which is
the new date/time after applying the offset. Have a look at the secton
in the org manual on table formulas and the calc manual in info.

--
Tim Cross



--
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &qu= ot;This ignorance about the limits of the earth's ability to absorb
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pollutants should be reason enough for= caution in the release
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 of pollutin= g substances."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0=C2=A0 ---Meadows et al.=C2=A0=C2=A0= 1972.=C2=A0 Limits to Growth. =C2=A0=C2=A0 =C2=A0 (p. 81)=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=
--000000000000b8b10905b617b8fb--