emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Date arithmetic in tables
@ 2008-04-29 12:29 Chris Randle
  0 siblings, 0 replies; only message in thread
From: Chris Randle @ 2008-04-29 12:29 UTC (permalink / raw)
  To: emacs-orgmode

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-29 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-29 12:29 Date arithmetic in tables Chris Randle

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).