[Overview][Constants][Procedures and functions][Index] Reference for unit 'dateutils' (#rtl)

WeeksInYear

return the number of weeks in the year, given a date

Declaration

Source position: dateutil.inc line 96

function WeeksInYear(

  const AValue: TDateTime

):Word;

Arguments

AValue

  

Day in the year.

Function result

Number of weeks.

Description

WeeksInYear returns the number of weeks in the year part of AValue. 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

WeeksInAYear

  

Return the number of weeks in a given year

DaysInYear

  

Return the number of days in the year in which a date occurs.

DaysInAYear

  

Number of days in a particular year.

DaysInMonth

  

Return the number of days in the month in which a date occurs.

DaysInAMonth

  

Number of days in a month of a certain year.

Example

Program Example12;

{ This program demonstrates the WeeksInYear function }

Uses SysUtils,DateUtils;

Var
  Y : Word;

Begin
  For Y:=1992 to 2010 do
    Writeln(Y,' has ',WeeksInYear(EncodeDate(Y,2,1)),' weeks.');
End.

Documentation generated on: Nov 16 2015