Re: A86: Calender Formulas


[Prev][Next][Index][Thread]

Re: A86: Calender Formulas




hmm...

get the year first

subtract 31+28 days to get to the end of february

subtract 365 four times (1984 was a leap year, yeah?)
then subtract one
(maybe worry about 2100 not being a leap year)

then start chopping months off until you get less than the number of days
in that month (add a year if you go past december)


to get day of week, number them 0-6, add whatever day jan 1, 1984 was to
your original number, then take the total mod 7


i think that would work...

or maybe subtract one _before_ you subtract 365 four times?

-josh


On Fri, 2 Feb 2001 14:09:01 -0500 malcolmj1@juno.com writes:
> 
> i've been fumbling around trying to figure out a routine to convert
> number such as 32332, the number of days since 'sun, jan 1, 1984', 
> to a
> date such as 'tues, feb 5, 1998' (that isn't correct but it's just 
> to get
> the idea).
> 
> has anyone created a routine such as this?  or have an idea as to 
> how to
> write one?
> 
> i just can't account for leap years.
> 
> jimi malcolm
> mailto:malcolmj1@juno.com
> http://guide.ticalc.org
> ________________________________________________________________
> GET INTERNET ACCESS FROM JUNO!
> Juno offers FREE or PREMIUM Internet access for less!
> Join Juno today!  For your FREE software, visit:
> http://dl.www.juno.com/get/tagj.
> 
> 
________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.