<%=FormatDateTime(rsTutorial2("waktu_mula"),vbLong Time)%>
output --> 2:00:00 PM
how to remove second from display. it's should be 2:00 PM
i have this function and output remove second. i dont know to make this function to read from database field waktu_mula = 14:00:00 using recordset.
<%
Function rDateTime(rTime)
DIM myAMPM, myHour, myColon, myMinute
'get AM or PM from the time
myAMPM = Right(rTime,2)
'get Hour and Minute
myColon = instr(1, rTime, ":",vbBinaryCompare)
IF myColon = 2 THEN
myHour = Left(rTime,1)
myMinute = Mid(rTime, 3, 2)
ELSE
myHour = Left(rTime,2)
myMinute = Mid(rTime, 4, 2)
END IF
'concatenate the time
myTime = myHour & ":" & myMinute & " " & myAMPM
'concatenate variables
rDateTime = "<font class='time'>" & myTime & "</font>"
End Function
%>
<%=rDateTime(Time())%>