Re: A86: Calender Formulas


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

Re: A86: Calender Formulas




That should actually be 365.25 days in a year (365 on a normal year, 366 on
a leap year).  Also, if the century is not divisible by 400, then it is not
a leap year.  i.e., 2000 was a leap year, but 2100 will not be.  Since you
are using the PHP functions to test out your code, I suggest you look at the
source code for those functions.  They are located in the following file in
the PHP source (for the current version):

php-4.0.4pl1\ext\standard\datetime.c

> >i just can't account for leap years.
>
> to account for leap years just say that there are 364.25 days in a year.
Or put
> in a counter and everytime it reaches Feb 28 check to see if the counter
is 4
> or whatever and then tell it to stick another day in Feb29.





References: