Org-mode mailing list
 help / color / mirror / Atom feed
From: Tim Cross <theophilusx@gmail.com>
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
Message-ID: <87wnxrjjl2.fsf@gmail.com> (raw)
In-Reply-To: <CAF-1L2Qzc8tfPgr=Ez+PNhHmHjgtm6Wq5PyAgCku337ANOMRig@mail.gmail.com>


Alan E. Davis <lngndvs@gmail.com> 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


  reply	other threads:[~2020-12-09 11:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09 10:20 Alan E. Davis
2020-12-09 11:34 ` Tim Cross [this message]
2020-12-10  8:10   ` Alan E. Davis
2020-12-10 19:01     ` Tim Cross
2020-12-11  0:12       ` Alan E. Davis
2020-12-11 15:40         ` Maxim Nikulin
2020-12-11 22:44           ` Alan E. Davis
2020-12-12 16:04             ` Maxim Nikulin
2020-12-12 22:52               ` Tim Cross
2020-12-13  3:14                 ` Alan E. Davis
2020-12-13 17:03                   ` Maxim Nikulin
2020-12-14  2:29                     ` Alan E. Davis
2020-12-12  3:31           ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://orgmode.org

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnxrjjl2.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git