Add to date

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.0


Add to date (date; years; months; days) Date

ParameterTypeDescription
dateDateDate to which to add days, months, and years
yearsNumberNumber of years to add to the date
monthsNumberNumber of months to add to the date
daysNumberNumber of days to add to the date
Function resultDateResulting date

Description

The Add to date command adds years, months, and days to the date you pass in date, then returns the result.

Although you can use the Date Operators to add days to a date, Add to date allows you to quickly add months and years without having to deal with the number of days per month or leap years (as you would when using the + date operator).

Example

      ` This line calculates the date in one year, same day 
   $vdInOneYear:=Add to date(Current date;1;0;0)

      ` This line calculates the date next month, same day
   $vdNextMonth:=Add to date(Current date;0;1;0)

      ` This line does the same thing as $vdTomorrow:=Current date+1
   $vdTomorrow:=Add to date(Current date;0;0;1)

See Also

Date Operators.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next