Examples Delphi

Sometimes you may need to increment a date by one month.
Simply adding 30 days won't do the trick, since some months do have 31 days.. not to forget the issue with leap years.
But there is a simple solution in SysUtils.pas: this unit provides a routine IncMonth().
Use it as in the following snippet:

var
OldDate,
NewDate : TDateTime;
begin
OldDate := ..
// now increment by one month
NewDate := IncMonth (OldDate, 1);
end;