Posting the description of the VBS DateAdd function
DateAdd(interval, number, date)
Arguments
interval
Required. A string expression that specifies the time interval to add. For values, see the "Settings" section.
number
Required. A numeric expression that specifies the number of time intervals to add. The numeric expression can be positive (to get a future date) or negative (to get a past date).
date
Required. A Variant or date literal representing the date to which interval is added.
Settings
The interval argument can have the following values:
Setting Description
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week
h Hour
n Minute
s Second
Description
You can use the DateAdd function to add or subtract a specified time interval from a date. For example, you can use DateAdd to calculate the date 30 days from today, or the time 45 minutes from now. To add a time interval in units of "days" to date, you can use "day of year" ("y"), "day" ("d"), or "weekday" ("w").
The DateAdd function does not return an invalid date. In the following example, one month is added to January 31, 1995:
NewDate = DateAdd("m", 1, "31-Jan-95")
In this example, DateAdd returns February 28, 1995, rather than February 31, 1995. If date is January 31, 1996, it returns February 29, 1996, because 1996 is a leap year.
If the calculated date is earlier than the year 100 AD, an error occurs.
If number is not a Long value, it is rounded to the nearest integer before calculation.
[ Last edited by yishanju on 2009-3-12 at 19:38 ]
有问题请发论坛或者自行搜索,再短消息问我的统统是SB