vlibDate

vLIB logo

6.21. weekOfYear()

Function Description
  weekOfYear (string timestamp [, bool start_monday])

Returns week of the year for the given timestamp.
If the start_monday parameter is true, the first Monday is first day of first week of the year, otherwise it's the first Sunday.

The timestamp parameter is a vlibDate timestamp. For more information, please see the IMPORTANT section.

Example

   echo $date->weekOfYear('1980-01-06'); //echo's '1'
   echo $date->weekOfYear('1980-01-06', true); //echo's '0'