From RAD Studio API Documentation
Jump to: navigation, search


function StartOfAWeek(const AYear, AWeekOfYear, ADayOfWeek: Word): TDateTime;


extern DELPHI_PACKAGE System::TDateTime __fastcall StartOfAWeek(const System::Word AYear, const System::Word AWeekOfYear, const System::Word ADayOfWeek = (System::Word)(0x1));


Type Visibility Source Unit Parent
function public
System.DateUtils System.DateUtils


Returns a TDateTime that represents the first moment on a specified day of a specified week.

StartOfAWeek returns the first expressible moment (12:00:00.000 A.M.) of the specified day of the specified week.

The AYear parameter specifies the year of the desired day.

The AWeekOfYear parameter specifies the week of the year, where 1 is the first week in AYear that includes four or more days.

The ADayOfWeek parameter indicates the desired day in the specified week, where 1 is Monday, 2 is Tuesday, and so on.

If the parameters do not specify a valid date, StartOfAWeek raises an EConvertError exception.

Note: The definitions for AWeekOfYear and ADayOfWeek follow the ISO 8601 standard.

See Also

Code Examples