date calculations

Kenneth Brody kenbrody at bestweb.net
Wed Mar 23 15:14:06 PST 2005


Quoting Fairlight (Wed, 23 Mar 2005 17:47:27 -0500):

> In the relative spacial/temporal region of
> Wed, Mar 23, 2005 at 05:08:32PM -0500, J. P. Radley achieved the
> spontaneous
> generation of the following:
> >
> > 	(test_date - @td) / "30"
>
> Surely that's not accurate.

That would be off by 5 days per year.  (6 in a leap year.)

I would use:

    (date2 - date1) / ( "365.25"/"12")
or
    (date2 - date1) / "30.4375"

This will still have the off-by-1 on occasion, depending on your
definition of "month", but it won't slip every year.

(And don't call me Shirley.)

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list