You are here: Re: date("W") and weeks of the year « All PHP « IT news, forums, messages
Re: date("W") and weeks of the year

Posted by PTM on 07/26/06 22:40

"fang" <fang27@excite.com> wrote in message
news:1153953097.557346.146340@b28g2000cwb.googlegroups.com...
> Does anyone know, or can explain, why January 16, 2005 would appear as
> week 2 when using date(W)?
>
> In my mind, January 16th should be week 3 - January 1 thru 7 being week
> 1, 8 thru 14 being week 2, and week 3 starting with the 15th.
>
> Thanks for any input,
>
> -Mike
>

Did loads of research into this a couple of years ago so here goes:

Week one is the week were the week of 1st January has more January days
included in it than December days.
Subsequent weeks start counting from there on.

In other words a week where 1st Jan is on Mon, Tues, Wed or Thur, is classed
as Week 1, if the 1st is on Fri, Sat or Sun then it is Week 5x of the
previous year (depending on whether the previous year has 52 or 53 weeks).

Hope this helps,

Phil

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация