| Date: | Mon, 29 Jul 1996 14:32:31 GMT |
| Reply-To: | David Nichols <nichols@SPSS.COM> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU> |
| From: | David Nichols <nichols@SPSS.COM> |
| Organization: | SPSS, Inc. |
| Subject: | Re: Subtracting dates |
|---|
In article <4ti3bc$b2n@lyra.csx.cam.ac.uk>,
K. Kafetsios <kk205@cus.cam.ac.uk> wrote:
>Have two variables in date format (day,month) and want to subtract the number
of days between the two. Read the functions list but had difficulty finding a
relevant function. Any ideas ?
COMPUTE NEWVAR=CTIME.DAYS(VAR2-VAR1).
You can also take the difference and divide by 86,400, the number of seconds
in a day, since dates are stored internally in seconds since the beginning
of the Gregorian calendar.
--
-----------------------------------------------------------------------------
David Nichols Senior Support Statistician SPSS, Inc.
Phone: (312) 329-3684 Internet: nichols@spss.com Fax: (312) 329-3668
-----------------------------------------------------------------------------
|