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 CHwtIV630F8dPwAA0tVLHw (envelope-from ) for ; Wed, 09 Dec 2020 11:39:10 +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 QBH7HF630F+/JgAAB5/wlQ (envelope-from ) for ; Wed, 09 Dec 2020 11:39:10 +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 9C782940429 for ; Wed, 9 Dec 2020 11:39:09 +0000 (UTC) Received: from localhost ([::1]:40948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmxoI-0004Bo-Q7 for larch@yhetil.org; Wed, 09 Dec 2020 06:39:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmxnO-0004As-5u for emacs-orgmode@gnu.org; Wed, 09 Dec 2020 06:38:10 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:33765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kmxnM-00033A-II for emacs-orgmode@gnu.org; Wed, 09 Dec 2020 06:38:09 -0500 Received: by mail-pf1-x431.google.com with SMTP id p4so856752pfg.0 for ; Wed, 09 Dec 2020 03:38:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=A7d4zjfBAJhaU5E65Jul6zOfRO01XO/pfOQA70UynFQ=; b=R5I1nct2yNtFSYUFY2oHDyJK23p0YXS+AUmKPskdD7Wb8URNqBnLxclPk7bbAlFfja l6aV4blmGFmPn7C7DlFSch4JRk8YPYYUPQqK/Qm1hZn3QycuhOkZeESzo1ZGRqGbT8yf 5498r9WfE58CrYS47ulNq05Y8GzSJhUGQ4Ph+IRgaxsOTikgFBW/+elNsnBJH3ISVx1g ZEC38e4EHaE+KCYl+yhEtqB1liOIr+8gQPG0FVchjWeFt8HJV2gUJ7idkhyHcZ9x1Pei RJdb+MnKKgEp6TPcMYQMEei/b/791XkvOyxGr/Mxpe37MyLtTZfmGmWAE3O+KQwDsMzb tk3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=A7d4zjfBAJhaU5E65Jul6zOfRO01XO/pfOQA70UynFQ=; b=hzZCYAaOYwS8QM60nL1Mqb0iB4tzOj+bPyPkTFa2pRDbWOjvwX0do44jFZyzvmewh7 fgwSqNbHVyzbzwD/MKo9vjXk8T17eS7vj7NMo0SSlGYA9ixC9uX1FUMBRFF+g7s1E29X mowWrnUBmOUNf2Y5j5kDpPtlIXNSvaqTEG/Sx/pqzkPvXZcUgp5yMFXh/41jkiTkb0ZL Jg9vQQgZLA5PeUBaxQjXwpXm9b7mOWFm5RAy7jzT3HCLT1KnYuwqdZj61080Z9PbxWha vQeqBzaUF47EvLzjXf/KJg2bs7iG6a+3M0iYmqiiRVLRIKMpQGeMlBk4o0T1TwMm2ZbY JW1A== X-Gm-Message-State: AOAM5321oTsB7SVcXSeP/DzEuSA1q6OXFAj1guRzrMyOEnO4wRm7FcpC /UoQaiM7CIgWa9oBkTLIVaPdsAKao/VCLg== X-Google-Smtp-Source: ABdhPJwAcDXqAVWQ8iCc+2+X+dOXf2XteZWfIugCM9RsJtMndVIUQCG0t3mdTQobnHLD96DI7DXeww== X-Received: by 2002:a63:4821:: with SMTP id v33mr1598790pga.7.1607513886485; Wed, 09 Dec 2020 03:38:06 -0800 (PST) Received: from tim-desktop (203-206-9-140.dyn.iinet.net.au. [203.206.9.140]) by smtp.gmail.com with ESMTPSA id x188sm1886903pfd.43.2020.12.09.03.38.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Dec 2020 03:38:05 -0800 (PST) References: User-agent: mu4e 1.5.7; emacs 27.1.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: org-table change time from UTC to other timezones Date: Wed, 09 Dec 2020 22:34:22 +1100 In-reply-to: Message-ID: <87wnxrjjl2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=theophilusx@gmail.com; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.51 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=R5I1nct2; 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: 9C782940429 X-Spam-Score: -1.51 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: SSVpkyFahx6x 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