Re: Calendar/Date

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

 



Weeks in a year is 52 or 53
Days in a year is 365 and if a leap year 366

If (

(365 (Days Of a year) * (Years From 1940)) + (Number of leap years
since 1940, (Years From 1940 / 4)  (if its a Leap year -1)) + ((Days
>From 01-01) + 1) % 7 = (0-6 where 0 = Monday)

) is less then 3 (Thursday) then its in week nr 01 else if equal to 4
(Friday) its week 53 else its week 52

http://threesides.kronan-net.com/2008/08/04/date-calculation-algorithm/
-- 
MvH / Hans Åhlin - www.kronan-net.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux