From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: foomaster1200 Newsgroups: gmane.emacs.help Subject: Re: variables for yesterday and today Date: Tue, 15 Oct 2002 06:52:43 GMT Organization: Road Runner - Texas Sender: help-gnu-emacs-admin@gnu.org Message-ID: <87adlgw5vj.fsf@gentoo.shacknet.nu> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1034665014 31790 80.91.224.249 (15 Oct 2002 06:56:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 15 Oct 2002 06:56:54 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 181LdM-0008Gc-00 for ; Tue, 15 Oct 2002 08:56:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 181Lck-0002lw-00; Tue, 15 Oct 2002 02:56:14 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!snoopy.risq.qc.ca!newsfeed.news2me.com!news-west.rr.com!cyclone.austin.rr.com!twister.austin.rr.com.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-NNTP-Posting-Host: 66.25.132.244 Original-X-Complaints-To: abuse@rr.com Original-X-Trace: twister.austin.rr.com 1034664763 66.25.132.244 (Tue, 15 Oct 2002 01:52:43 CDT) Original-NNTP-Posting-Date: Tue, 15 Oct 2002 01:52:43 CDT Original-Xref: shelby.stanford.edu gnu.emacs.help:106076 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2623 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2623 ken writes: > I'm not a great elisp coder, but figured it would be trivial to create a > couple variables similar to current-time, but containing the values for > yesterday and tomorrow, bzw. 'current-time - 86400 seconds' and > 'current-time + 86400 seconds'. > > But it's not trivial at all, at least not how I've seen it. So before > reinventing the wheel, has anyone coded these before? I'm still pretty fresh to LISP in general, but this would be my first hack; ,---- | (defun yesterday-time () | (let ((1day-lsw (% 86400 (<< 1 16))) | (1day-msw (/ 86400 (<< 1 16))) | (now (current-time))) | (list | (+ (car now) 1day-msw) | (+ (car (cdr now)) 1day-lsw) | (car (cdr (cdr now)))))) `---- The main thing to remember is integers in Emacs are 28 bits I guess. -- You mean you don't want to watch WRESTLING from ATLANTA?