ex105.pp 356 B

123456789101112131415
  1. Program Example105;
  2. { This program demonstrates the DecodeDayOfWeekInMonth function }
  3. Uses SysUtils,DateUtils;
  4. Var
  5. Y,M,NDoW,DoW : Word;
  6. D : TDateTime;
  7. Begin
  8. DecodeDayOfWeekInMonth(Date,Y,M,NDoW,DoW);
  9. D:=EncodeDayOfWeekInMonth(Y,M,NDoW,DoW);
  10. Write(DateToStr(D),' is the ',NDow,'-th ');
  11. Writeln(formatdateTime('dddd',D),' of the month.');
  12. End.