WeeksInAYear

Return the number of weeks in a given year

Declaration

Source position: dateutil.inc line 97

  function WeeksInAYear(const AYear: Word) : Word;

Description

WeeksInAYear returns the number of weeks in the year AYear. The return value is either 52 or 53.

Remark

The first week of the year is determined according to the ISO 8601 standard: It is the first week that has at least 4 days in it, i.e. it includes a Thursday. !!!

See also

Name Description
DaysInAMonth Number of days in a month of a certain year.
DaysInAYear Number of days in a particular year.
DaysInMonth Return the number of days in the month in which a date occurs.
DaysInYear Return the number of days in the year in which a date occurs.
WeeksInYear return the number of weeks in the year, given a date

Example

Program Example13;
{ This program demonstrates the WeeksInAYear function }
Uses SysUtils,DateUtils;
Var
  Y : Word;
Begin
  For Y:=1992 to 2010 do
    Writeln(Y,' has ',WeeksInAYear(Y),' weeks.');
End.