emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Chris Randle <chris@amlog.co.uk>
Cc: emacs-orgmode@gnu.org
Subject: Re: Problem with date calculations in a table
Date: Fri, 15 Aug 2008 07:56:01 -0400	[thread overview]
Message-ID: <8931.1218801361@gamaville.dokosmarshall.org> (raw)
In-Reply-To: Message from "Chris Randle" <chris@amlog.co.uk> of "Fri, 15 Aug 2008 10:24:39 BST." <76D4727F59354728AA93049264DCF1F7@CUBE>

Chris Randle <chris@amlog.co.uk> wrote:

> Nick Dokos wrote:
> > I've been trying to make a table with the following structure: column
> > 1 contains either a date or is empty; column 2 contains a date that's
> > calculated from the corresponding date in column 1 (if column 1
> > contains a date) or is empty (if column 1 is empty). In the example
> > below, column 2 is supposed to be the date 12 hours or 0.5 days after
> > the date in column 1 (assuming that it is non-empty).     
> 
> I had problems getting date arithmetic to work in tables. I posted my
> findings and solutions here:
> 
> http://article.gmane.org/gmane.emacs.orgmode/6536/
> 
> Don't know if it will fix your problem (too lazy to try!) but I suspect
> it will.
> 

It did! I don't understand the details yet but the following seems to do
what I want:

| start                | ETA (start + 12 hrs)   |
|----------------------+------------------------|
| 2008-08-14 Thu 18:15 | <2008-08-15 Fri 06:15> |
|                      |                        |

#+TBLFM: $2=(date(<$1>) ? <$1>+0.5 : string(""))

The date in the first column can be just a string as above, a passive
date or an active date (the file is not in the agenda list so I don't
really have to worry about active dates).

Thanks very much,
Nick

  reply	other threads:[~2008-08-15 11:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-14 23:48 Problem with date calculations in a table Nick Dokos
2008-08-15  9:24 ` Chris Randle
2008-08-15 11:56   ` Nick Dokos [this message]
     [not found] <20080815115807.E38CF21E5C@mailhost.cs.tu-berlin.de>
2008-08-15 17:20 ` Stephan Schmitt

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://www.orgmode.org/

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

  git send-email \
    --in-reply-to=8931.1218801361@gamaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).