Forums
This topic is locked
Date diff function
Posted 15 Apr 2002 21:19:09
1
has voted
15 Apr 2002 21:19:09 Matthijs Horsman posted:
Hello all,I am trying to mess around with some date varibles with the diffdate function
Works out pretty nice BUT i can'y seem to get the right output!
Say i have these two dates:
01-01-2002 23:15 (DD/MM/YYYY and time)
02-01-2002 12:00
and i want it to become 12,30 (twelve hours and 30 minutes)
My code know is
<% =DateDiff("n", 01-01-2002 23:30, 02-01-2002 12:00)/60 %>
wich results in 12,50 which is ok, but i need it to be 12,30 (twelve hours and 30 minutes)
I tried to use the replace function like this:
<%= replace(DateDiff("n", sd, ed)/60, 75, "45" %>
Wichh works out great for al the numbers that have to be reduced from 75 to 45 but thats only one (i am gone work in whole quarters so i only need to add 15, 30 and 45) but maybe there's another way....
Thanks in advance
Grrrr
Matthijs
----------------
UD4/WY2K/IIS/ASP-VB
Edited by - matthijshorsman on 16 Apr 2002 02:47:25