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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.