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?

19 of 37 people (51%) answered Yes
Recently 5 of 10 people (50%) 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.