Function to add or subtract the number of weeks to the specified date.
function IncWeek(dt: double; iWeeks: int64): double;
Parameter |
Type |
Value |
---|---|---|
dt |
double |
date/time value to which you need to add or subtract the number of weeks; |
iWeeks |
int64 |
number of weeks which you need to add or subtract. If the number is positive — add weeks, if negative — subtract. |
Returns a date shifted by a specified number of weeks.
var
dt: double;
begin
dt := Now;
mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss:zzz', dt), 'now');
dt := IncWeek(dt, 4);
mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss:zzz', dt), '+4 weeks');
end.
[15:40:11] (Log "IncWeek"): [now] 02.23.2016 15:40:11:803
[15:40:11] (Log "IncWeek"): [+4 weeks] 03.22.2016 15:40:11:803