WeeksInAYear function
Returns the number of weeks in a given year.
Declaration
function WeeksInAYear(const AYear: Word): WordArguments
AYear | A (valid) year. |
Function result
Number of weeks in
AYear.
Description
WeeksInAYear returns the number of weeks in the year
AYear. The return value is either 52 or 53.
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
Example: ex13
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.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
