I know there is a datediff() function to calculate the time different between different days. Is there a way to calculate the time difference between the same date?
DateDiff can calculate between times as well. The function name can be confusing, but it is referring to Date objects (which include times) just not dates.
Anyway, you can do this:
DateDiff(interval,date1,date2)
Intervals can be any of the following:
Setting 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
To calculate times, date1 and date2 need to be VB/VBScript date variable types.
Hope this clarifies for you. Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
--------------------------------------------- Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'DateDiff'
/date.asp, line 6
---------------------------------------------
Here is a sample of what I typed, maybe you can tell me what I'm doing wrong.
<%
Dim date1, date2, differs
date1 = "6/17/1988"
date2 = "9/14/1997"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.