faqts : Computers : Programming : Languages : PHP : Function Libraries : Date and Time

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

20 of 38 people (53%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How can I calculate the week of a month/year? ist week, 2nd week etc...

Jan 22nd, 2002 10:21
Steve Holmquist, Sheni R. Meledath,


Here is a script I use.

$week = ceil(date('z') / 7+.5); 


This will return the number of the current week.

For the year 2002 it starts the new week on Sunday. For 2001, it started the new week on Friday.