ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

I need help with ASP dates (date difference)

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming
View previous topic :: View next topic  
Author Message
tim



Joined: 02 Nov 2004
Posts: 5

PostPosted: Tue Nov 02, 2004 10:16 am    Post subject: I need help with ASP dates (date difference) Reply with quote

Hi all,

I need a little help with APS dates. I have 2 dates in one of my ASP pages, and I want to calculate the difference between the 2 dates in days. How do I do that?



Thank you in advance,

Tim
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Tue Nov 02, 2004 2:47 pm    Post subject: Reply with quote

Hi Tim,

APS (VBScript) has a function called DateDiff, which returns the difference between 2 dates (you have to specify in what time interval - days, hours, minutes, etc.). Here is how to use it:

Code:

Response.Write DateDiff("d", "01/01/2004","01/31/2004")



The DateDiff code above will display 30 in your browser.


Cheers,
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
tim



Joined: 02 Nov 2004
Posts: 5

PostPosted: Tue Nov 02, 2004 4:00 pm    Post subject: Reply with quote

Thank you!


Tim
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group

SQL Tutorial