DecodeDayOfWeekInMonth procedure
Decode a TDateTime value in year, month, day of week parts.
Declaration
procedure DecodeDayOfWeekInMonth(const AValue: TDateTime;
out AYear: Word; out AMonth: Word;
out ANthDayOfWeek: Word;
out ADayOfWeek: Word)Arguments
AValue | TDateTime to decode. |
AYear | Returns the year part of
|
AMonth | Returns the month part of
|
ANthDayOfWeek | Returns which
|
ADayOfWeek | Returns the day of week part of
|
Description
DecodeDayOfWeekInMonth decodes the date
AValue in a
AYear,
AMonth,
ADayOfweek and
ANthDayOfweek.
(This is the N-th time that this weekday occurs in the month, e.g. the
third Saturday of the month.)See also
Example: ex105
Program Example105;
{ This program demonstrates the DecodeDayOfWeekInMonth function }
Uses SysUtils,DateUtils;
Var
Y,M,NDoW,DoW : Word;
D : TDateTime;
Begin
DecodeDayOfWeekInMonth(Date,Y,M,NDoW,DoW);
D:=EncodeDayOfWeekInMonth(Y,M,NDoW,DoW);
Write(DateToStr(D),' is the ',NDow,'-th ');
Writeln(formatdateTime('dddd',D),' of the month.');
End.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
