4D v14.3Add to date |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
Add to date
|
Add to date ( date ; years ; months ; days ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
date | Date |
![]() |
Date to which to add days, months, and years | |||||
years | Longint |
![]() |
Number of years to add to the date | |||||
months | Longint |
![]() |
Number of months to add to the date | |||||
days | Longint |
![]() |
Number of days to add to the date | |||||
Function result | Date |
![]() |
Resulting date | |||||
The Add to date command adds years, months, and days to the date you pass in aDate, 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).
` 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)
Product: 4D
Theme: Date and Time
Number:
393
Created: 4D v6
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)