tags:

views:

63

answers:

3

Is there a way to find the weeknumber within the year using PHP?

A: 

I believe the most standard is called GPS Week Number, see http://www.ngs.noaa.gov/CORS/Gpscal.html

Current week ID is 1578.

Pavel Radzivilovsky
+5  A: 

You can do this using date, using the W format string, which returns:

ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0)

e.g.

date("W");
Dominic Rodger
+2  A: 

Try date('W'); http://my2.php.net/manual/en/function.date.php

Steve
heh. Dominic beat me to it by 30 seconds...
Steve
So I did, +1 :)
Dominic Rodger