Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2004, 03:57 AM
Authorized User
 
Join Date: Mar 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Date() question

Hello!

I am new in here and liked the site a lot

THUMBs UP

my question:

I know that in asp to get today's date we use this function:

date()

but how can i get the date like 20 days after today's date?

help appreciated

thanks in advance!!

__________________
What Comes Around Goes Around!
 
Old March 3rd, 2004, 04:09 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

One way is to just add 10 to the Date() method like this:

Response.Write("10 days from now is " & Date() + 10)

However, IMO it's better to use the DateAdd function. This allows you to add other units as well (hours, minutes, years, whatever):

Response.Write("10 days from now is " & DateAdd("d", 10, Date()))

For more info about DateAdd, see:
http://msdn.microsoft.com/library/de...fctdateadd.asp


HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old March 3rd, 2004, 04:14 AM
Authorized User
 
Join Date: Mar 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Thanks Imar

that was quick and to the point

thanks. it worked fabulously






Similar Threads
Thread Thread Starter Forum Replies Last Post
Date question kscase SQL Language 3 July 17th, 2007 07:39 AM
Date/Time Sort Question Pam S Access 2 April 23rd, 2005 09:18 AM
Date of birth question satts Access 10 February 24th, 2005 11:21 AM
Simple Date question risu VB.NET 2002/2003 Basics 7 November 12th, 2003 12:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.