Org-mode mailing list
 help / color / Atom feed
From: "Chris Randle" <chris@amlog.co.uk>
To: emacs-orgmode@gnu.org
Subject: Date arithmetic in tables
Date: Tue, 29 Apr 2008 13:29:10 +0100
Message-ID: <00be01c8a9f4$a310ca00$6580a8c0@CUBE> (raw)

Hi All

This post started as a problem and question, but I found a solution. I
thought I'd document my observations. Forgive me if it's obvious, but it
wasn't to me!

I had trouble with date arithmetic in an org table, I think because the
function thought that inactive dates were vectors:

| Date             | Days before today
|
|------------------+----------------------------------------------------
----|
| <2008-03-22 Sat> | 38.540
|
| [2008-03-22 Sat] | [<2002-11-24 Sun 12:57>, <2008-04-29 Tue 12:57> -
Sat] |
#+TBLFM: $2=now()-$1

I didn't want to use active dates, as I didn't want the heading to
appear in the agenda. Starting to play around, I discovered that

<[2008-03-22 Sat]>

would work as an inactive date acceptable to the formula, but the
trailing ">" was stripped when using keystrokes to adjust the date. So
then I noticed that

<[2008-03-22 Sat]

would work still, and nothing was lost during adjustment. Which finally
led to the discovery that

[2008-03-22 Sat]

also works if the formula is adjusted to

#+TBLFM: $2=now()-<$1>

Hope this helps others.

-- 
Chris Randle
Org-mode 6.02. Emacs 22.1.1. Windows XP.

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='00be01c8a9f4$a310ca00$6580a8c0@CUBE' \
    --to=chris@amlog.co.uk \
    --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

Archives are clonable:
	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