DateAdd function to add date and timeWe can add date by using DateAdd function of VBScript using in ASP. We can add any type of value like day, month , year etc using DateAdd function. Here is the syntax for the DateAdd function.
DateAdd ( date_type, increment_by, date)Here date_type is the type of date to be added. It can be month, year, Day, Hour, minute etc. Different values are available in a table at the end of this tutorial. The argument increment_by is the interval we want to add to the third argument date.
Here is the code explaining the use of DateAdd function.
In the above code we have added five years to the current date. By changing the value of date_type we can add month, days etc to the present date. Here is the code to add 6 months to today.
|"ww"||Week of the year|
Be the first to post comment on this article :
|ASP Date & Time Functions|
Getting todays Date and Time based on local settings|
Formatting date and time on local settings
Adding Date intervals using DateAdd function
Finding difference between two dates using DateDiff function
Collecting parts of Date by using DatePart function
Collecting Month name by using Month number by MonthName function
Collecting Name of the weekday of any Date by WeekDayName function
Generating Date variables by using Month, Day and Year Value
Function IsDate to check valid date or date variable
Checking user entered date value