Re: A Difference of Months
Re: A Difference of Months
- Subject: Re: A Difference of Months
- From: Shane Stanley <email@hidden>
- Date: Wed, 13 Mar 2002 11:50:28 +1100
On 13/3/02 8:55 AM +1000, Arthur J Knapp, email@hidden, wrote:
>
So I need to find how many months difference there are between any
>
two dates. If it was a question of days, it would be very simple:
>
>
Months are not as simple, however, because they have a differing
>
number of days. The only *simple* technique that can be used is to
>
find an approximation of months difference:
If you're happy to disregard days, why not just get the number of months of
each date by multiplying the years by 12 and adding the current month:
on getMonths(theDate)
copy theDate to b
set month of b to January
set theMonths to ((year of theDate) * 12) + (1 + (theDate - b + 1314864)
div 2629728)
return theMonths
end getMonths
--
Shane Stanley, email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.