Jump to content

problem with calling week number 2009


ahhoi

Recommended Posts

There are about 52.18 weeks in a year.  I think that January 2nd this year falls after the 53rd week.  It could have something to do with your computer's time on the Mac though.  I don't know.  Is it mission-critical?

 

According to ISO specification (on which the PHP date functions are based!?) the 2.1.09 is in week 53. Yep, it's very critical as a major script is built upon correct/valid week number function :-// thx

There are about 52.18 weeks in a year.  I think that January 2nd this year falls after the 53rd week.  It could have something to do with your computer's time on the Mac though.  I don't know.  Is it mission-critical?

 

According to ISO specification (on which the PHP date functions are based!?) the 2.1.09 is in week 53. Yep, it's very critical as a major script is built upon correct/valid week number function :-// thanks

 

According to wikipedia, this is week 1.

 

There are mutually equivalent descriptions of week 01:

 

    * the week with the year's first Thursday in it (the formal ISO definition),

    * the week with 4 January in it,

    * the first week with the majority (four or more) of its days in the starting year, and

    * the week starting with the Monday in the period 29 December – 4 January.

 

If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in week 01. If 1 January is on a Friday, Saturday or Sunday, it is in week 52 or 53 of the previous year. 28 December is always in the last week of its year.

In case anyone else is interested:

<< < January 2009 > >>

Wk Mo Tu We Th Fr Sa Su

(1) 29 30 31 1 2 3 4

(2) 5 6 7 8 9 10 11

(3) 12 13 14 15 16 17 18

(4) 19 20 21 22 23 24 25

(5) 26 27 28 29 30 31 1

They had that on the Wiki article, which was actually rather informative.  I never bothered learning about week numbering like that.  Cool.

 

EDIT: It won't line up for me, but you get the idea.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.