Promotic
WikipediaLinkedInYoutubeTwitterFacebook

DateAdd - function of language VBScript

Description:
Returns a date to which a specified time-span has been added.

For the purposes of PROMOTIC system, it is more usefull to use the method: Pm.DateAdd.

Syntax:
DateAdd(interval As String, number As Long, date As Date) As Date
Calling:
d = DateAdd(interval, number, date)
Parameters:
interval(String) Specifies added interval (type of time range):
yyyy - year
q - quarter
m - month
y - day of year
d - day
w - day of the week
ww - week of year
h - hour
n - minute
s - second
number(Long) The number of interval you want to add. The number can either be positive number, for dates in the future, or negative number, for dates in the past.
date(Date) Date to which interval is added.
Note:

The function can be used to add or subtract a specified time interval from a date. For example, it can be used to calculate a date 30 days from today or a time 45 minutes from now.

To add days to date, can be used day of year ("y"), day ("d") or day of the week ("w").

If the computed date is before year 100, then an error occurs.

Example:
The Example adds one month to 31-Jan-2019:
VBScriptSelect and copy to clipboard

Dim NewDate
NewDate = DateAdd("m", 1, "31-Jan-2019")
PROMOTIC 9.0.0 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice