PDA

View Full Version : Get the time differnet from two date


cloudy
02-28-2008, 03:59 AM
DateDifferent=DateDiff("d",Date(),rsSelect("ExpiryDate"))

tis is the code to get the date differnt between date now with the date from the DB. becoz the interval is Date(d), how can i get the time different between the time? and the PM and AM too..plz help .thank you

angst
02-28-2008, 03:55 PM
simple:


response.write DateDiff("n",CDate("28/02/2008 8:48:37 AM"),CDate("28/02/2008 10:48:37 AM"))



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

http://www.w3schools.com/vbscript/func_datediff.asp