AddDate()
Syntax
Date = AddDate(Date, Field, Value)Description
Add a value to a date. The 'Field' can be one of the following constants:#PB_Date_Year : Will add 'Value' Year to the date #PB_Date_Month : Will add 'Value' Month to the date #PB_Date_Week : Will add 'Value' Week to the date #PB_Date_Day : Will add 'Value' Day to the date #PB_Date_Hour : Will add 'Value' Hour to the date #PB_Date_Minute : Will add 'Value' Minute to the date #PB_Date_Second : Will add 'Value' Second to the dateNote: when #PB_Date_Month is used, it will automatically account for the fact that the numbers of days per month varies, for example: if a month is added to '31 march 2008' the result will be '30 april 2008', since april does not have 31 days.
Example:
Debug FormatDate("%yyyy/%mm/%dd", AddDate(Date(), #PB_Date_Year, 2)) ; Returns the current date + 2 years Debug FormatDate("%mm/%dd/%yyyy", AddDate(Date(), #PB_Date_Year, 2)) ; Returns the current date + 2 years
Supported OS
All