ex15.pp 582 B

123456789101112131415161718
  1. Program Example15;
  2. { This program demonstrates the IncMonth function }
  3. Uses sysutils;
  4. Var ThisDay : TDateTime;
  5. Begin
  6. ThisDay:=Date;
  7. Writeln ('ThisDay : ',DateToStr(ThisDay));
  8. Writeln ('6 months ago :',DateToStr(IncMonth(ThisDay,-6)));
  9. Writeln ('6 months from now :' ,DateToStr(IncMonth(ThisDay,6)));
  10. Writeln ('12 months ago :',DateToStr(IncMonth(ThisDay,-12)));
  11. Writeln ('12 months from now :' ,DateToStr(IncMonth(ThisDay,12)));
  12. Writeln ('18 months ago :',DateToStr(IncMonth(ThisDay,-18)));
  13. Writeln ('18 months from now :' ,DateToStr(IncMonth(ThisDay,18)));
  14. End.