summaryrefslogtreecommitdiff
path: root/fpcdocs/datutex/ex105.pp
blob: a0e4bf678618e269140967509c5b97e90f665d16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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.