Add / Subtract from Dates ASP Script - ASP Web Pro
  Active Server Pages Programming by ASP Web Pro

ASP Scripts

ADD / SUBTRACT FROM DATES

It is often necessary to add or subtract values from dates. Here are a few examples of how to do it:

Adding to Dates

<%
Response.Write DateAdd ("m", 1, #4/17/01#)
%>

This adds one month to the date 4/17/01: 17/05/2001

<%
Response.Write DateAdd ("d", 1, Date)
%>

This displays tomorrows date like this: 07/07/2008

Subtracting from Dates

<%
Response.Write DateAdd ("d", -1, Date)
%>

This displays yesterdays date like this: 05/07/2008

< Back to ASP Scripts


 

 

Main Menu
Home
ASP Scripts
ASP Tutorials
JavaScripts
Awards
Contact Us

Email This Page

Other Resources
ASP Web Hosting
Search Engine Submission
Programming Help

 

 

 

Other ASP Web Sites

Site Map

 

Last Updated:
06 July 2008