From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: how do you compute date difference in emacs? Date: Sat, 17 Apr 2010 00:38:33 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <1acb4c85-70bd-4f58-bbb1-b13370eca4c2@c21g2000yqk.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273061697 15876 80.91.229.12 (5 May 2010 12:14:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 12:14:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 05 14:14:56 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9dV9-0001L3-LP for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 14:14:55 +0200 Original-Received: from localhost ([127.0.0.1]:39331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9dV8-0006kl-Ls for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 08:14:54 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!k41g2000yqf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 29 Original-NNTP-Posting-Host: 76.102.12.87 Original-X-Trace: posting.google.com 1271489913 11811 127.0.0.1 (17 Apr 2010 07:38:33 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 17 Apr 2010 07:38:33 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k41g2000yqf.googlegroups.com; posting-host=76.102.12.87; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1045 Safari/532.5,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:177742 comp.emacs:99750 X-Mailman-Approved-At: Tue, 04 May 2010 16:54:49 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:73411 Archived-At: On Apr 16, 9:42=C2=A0pm, Jason Rumney 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 > 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 > > =C2=A0"%Y-%m-%d" > > =C2=A0(time-subtract (date-to-time "2010-04-16 00:00") (days-to-time 21= 5))) > > > 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 =E2=88=91 http://xahlee.org/ =E2=98=84