LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2003)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 1 May 2003 13:33:08 -0400
Reply-To:     Mark Casazza <mark.casazza@domino1.cuny.edu>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Mark Casazza <mark.casazza@domino1.cuny.edu>
Subject:      Re: time interval
Comments: To: "Yampolskaya, Svetlana" <yampol@fmhi.usf.edu>
In-Reply-To:  <CF25F31EC35DD411B3A500B0D020F0F005AD8EEF@mirage.fmhi.usf.edu>
Content-Type: text/plain; charset="iso-8859-1"

Hi Lana,

The days part isn't difficult, it looks like:

compute interval = ctime.days(recent_date - old_date).

As for the months, that's more difficult since months have different numbers of days. If you can settle for an approximation divide the number of days (interval) by 30 and you'll be reasonably close. If you need to compute this for the actual months involved, take a look at Raynald's site--I think he worked this out once before and the code's probably there.

Mark Casazza Director of Academic Information The City University of New York 555 West 57th St. Suite 1240 New York, NY 10019

phone: 212.541.0396 fax: 212.541.0372 mark.casazza@mail.cuny.edu

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of Yampolskaya, Svetlana Sent: Thursday, May 01, 2003 1:08 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Re: time interval

Dear List,

I have two dates (two date variables (e.g., mm/dd/yyyy). I need to calculate the difference between them in days. How can I do it? Please help.

And then what if I need that difference in months?

Thank you in advance,

Lana


Back to: Top of message | Previous page | Main SPSSX-L page