IncWeek
Increase a TDateTime value with a number of weeks.
Declaration
Source position: dateutil.inc line 287
function IncWeek(const AValue: TDateTime; const ANumberOfWeeks: Integer)
: TDateTime;
function IncWeek(const AValue: TDateTime) : TDateTime;
Description
IncWeek adds ANumberOfWeeks weeks to AValue and returns the resulting date/time.ANumberOfWeeks can be positive or negative.
See also
| Name | Description |
|---|---|
| IncDay | Increase a TDateTime value with a number of days. |
| IncHour | Increase a TDateTime value with a number of hours. |
| IncMilliSecond | Increase a TDateTime value with a number of milliseconds. |
| IncMinute | Increase a TDateTime value with a number of minutes. |
| IncSecond | Increase a TDateTime value with a number of seconds. |
| IncYear | Increase a TDateTime value with a number of years. |
| #rtl.sysutils.IncMonth | Increases the month in a TDateTime value with a given amount. |
Example
Program Example73;
{ This program demonstrates the IncWeek function }
Uses SysUtils,DateUtils;
Begin
Writeln('One Week from today is ',DateToStr(IncWeek(Today,1)));
Writeln('One Week ago from today is ',DateToStr(IncWeek(Today,-1)));
End.