snowboardr
Programmer
Hi, I am trying to display the difference in two dates using Datediff. Its for a forum script I am working on. However I can't seem to get it output right:
25HRS. 1507 mins ago
is what i am getting... I know my code is ugly, but i Just need to be pointed in the right direction on how to get the correct hrs and mins to show up then ill clean it up..
Thanks, for any help.
Jason
www.sitesd.com
ASP WEB DEVELOPMENT
25HRS. 1507 mins ago
is what i am getting... I know my code is ugly, but i Just need to be pointed in the right direction on how to get the correct hrs and mins to show up then ill clean it up..
Thanks, for any help.
Jason
Code:
'# DateDiff(interval,date1,date2[,firstdayofweek[,firstweekofyear]])
sDateTimeNow = Now()
sReplyDay = DateDiff("d",sReplyTime,sDateTimeNow)
sReplyHour = DateDiff("h",sReplyTime,sDateTimeNow)
sReplyMinute = DateDiff("n",sReplyTime,sDateTimeNow)
sReplyColor = "mt"
If sReplyDay < 2 then
If sReplyHour = 1 then
sReplyTimeLong = sReplyHour & "+ HRs. ago"
Else
If sReplyHour = 0 then
If sReplyMinute = "0" then
sReplyTimeLong = "NEW"
sReplyColor = "npst"
Else
sReplyTimeLong = sReplyMinute & " mins ago"
If sReplyMinute < 20 then
sReplyColor = "npst"
End If
End If
Else
sReplyTimeLong = sReplyHour & "HRS. " & sReplyMinute & "mins ago"
End If
End If
Else
sReplyTimeLong = sReplyTime
End If
www.sitesd.com
ASP WEB DEVELOPMENT