StartOfAWeek function
Return a day of the week, given a year, week and day in the week.
Declaration
function StartOfAWeek(const AYear: Word; const AWeekOfYear: Word;
const ADayOfWeek: Word): TDateTimeArguments
AYear | Year. |
AWeekOfYear | Week in the year. |
ADayOfWeek | Day in the week (default 1). |
Function result
First day of the given week, in
TDateTime format.
Description
StartOfAWeek
returns a
TDateTime value with the date of the indicated day of the
week indicated by the
AYear,
AWeek,
ADayOfWeek values.
The default value for ADayOfWeek is 1.
See also
Example: ex34
Program Example34;
{ This program demonstrates the StartOfAWeek function }
Uses SysUtils,DateUtils;
Const
Fmt = '"First day of this week : "dd mmmm yyyy hh:nn:ss';
Fmt2 = '"Second day of this week : "dd mmmm yyyy hh:nn:ss';
Var
Y,W : Word;
Begin
Y:=YearOf(Today);
W:=WeekOf(Today);
Writeln(FormatDateTime(Fmt,StartOfAWeek(Y,W)));
Writeln(FormatDateTime(Fmt2,StartOfAWeek(Y,W,2)));
End.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
