Print Page | Close Window

Dates Help

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5664
Printed Date: 31 March 2026 at 6:30am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Dates Help
Posted By: group1
Subject: Dates Help
Date Posted: 10 September 2003 at 7:38pm

Through the use of a form i am getting users to enter a specific date (mm/dd/yyyy) and a number of days

I want to basically get this number of days and add it to the date to calculate the end date

eg. user enters 01/31/2003 and the number 4, and I want an asp page to calculate as an output: 02/03/2003

I am aware of a function in asp which for example: <% Date + 4 %>

But how do I put my own date into this method, and make the ASP code realise it is a date

 




Replies:
Posted By: Phat
Date Posted: 10 September 2003 at 7:45pm

Use dateadd below is some info from a website.

Interval:

Description:
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week of year
h Hour
n Minute
s Second

Before: Code: After:
17.02.01 DateAdd("yyyy","1",yourdate) 17.02.02
17.02.01 DateAdd("m","1",yourdate) 17.03.01
17.02.01 DateAdd("q","1",yourdate) 17.05.01
 
James
 


-------------
http://buildit.sitesell.com/sitebuildithome.html - Get a website that sells


Posted By: b_bonnett
Date Posted: 10 September 2003 at 9:26pm

W3Schools has a good page on DateAdd: http://www.w3schools.com/vbscript/func_dateadd.asp - http://www.w3schools.com/vbscript/func_dateadd.asp

Blair



-------------
Webmaster, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net