ASP   «Prev 

DateAdd function example

ASP Date Function

ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and XML web services.
It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology.


Elements of the ASP script
Elements of the ASP script

  1. Create and initialize the two variables, dCurrDate and dNextMonth, that we need to perform the calculation.
  2. Use the Date() function for current date to set the value of variable dCurrDate to today's date.
  3. Use the DateAdd function with its parameter set to days, +30 and today's date to count 30 days past today and place the result in our other variable, dNextMonth. Note that the result date may or may not be in the same month as today's date.
  4. Display the new date, 30 days in the future to the user