help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how do you compute date difference in emacs?


From: Xah Lee
Subject: Re: how do you compute date difference in emacs?
Date: Tue, 04 May 2010 15:44:58 -0000
User-agent: G2/1.0

On Apr 16, 9:42 pm, Jason Rumney <jasonrum...@gmail.com> wrote:
> In calendar mode, you can do it interactively.
>
> From the "Goto" menu, you can find "Other date" which has the keyboard
> shortcut "g d" (in your example case you don't need this step, since
> the date was yesterdays date). Then you can use C-u NUMBER_OF_DAYS
> <left> to go back a number of days.

thanks a lot Jason. That does it. Pretty easy too.

> > For Jose Romero's suggestion:
>
> > (format-time-string
> >  "%Y-%m-%d"
> >  (time-subtract (date-to-time "2010-04-16 00:00") (days-to-time 215)))
>
> > this code results in "1999-05-30".
>
> In 23.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.3) of 2010-03-16 on
> crested, modified by Debian; the code above results in an error,
> because the seconds are required in the argument to date-to-time.

good info.

  Xah
∑ http://xahlee.org/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]