Regular Time   
 
I have been looking for an easy way to to use the VBScript FormatDateTime function to get me a time like: 3:47 PM.
For whatever reason.. you can't do that! So try this:
<%

Response.Write sTime(Now())
Private Function sTime(dtime)
hr = hour(dtime)
mn = minute(dtime)
  if hr > 12 then
  hr = hr - 12
  ampm = "PM"
  else
  ampm = "AM"
  end if
IF len(mn) = 1 then mn = 0 & mn

sTime = hr & ":" & mn & " " & ampm
End Function

%>


The Result: -1:59 PM

NOTE: This is SERVER time, not client time!

Thanks for the suggestion Ellen!
11:59 AM
My3C's
perrychicker
It's easy... it's a PSACAKE!
Back | Tell A Friend | Search this Site
1998 - 2014 psacake.com
Version 3.23

Send me One Million FREE Guaranteed Visitors