Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
response.write(FormatDate(Now())
Function FormatDate(dDate)
if not isdate(dDate) then
dDate = date()
end if
strDay = Day(dDate)
If Len(strDay) = 1 Then strDay = "0" & strDay
strMonth = month(dDate)
If Len(strMonth) = 1 Then strMonth = "0" & strMonth
strYear = Year(dDate)
If Len(strYear) = 4 Then strYear = Mid(strYear,3,2)
strHour = Hour(dDate) Mod 12
If strHour = 0 Then strHour = 12
If Hour(dDate) < 12 Then
strAMPM = "AM"
Else
strAMPM = "PM"
End If
strMinute = Minute(dDate)
If Len(strMinute) = 1 Then strMinute = "0" & strMinute
strSecond = Second(dDate)
If Len(strSecond) = 1 Then strSecond = "0" & strSecond
sFinal = strMonth & strDay & strYear & strHour & strMinute & strSecond & strAMPM
FormatDate = sFinal
End Function
<!-- in page -->
<%=customdatetime(now())%>
<!-- Functions -->
<%
Function customdatetime(datetimeval)
if isdate(datetimeval) then
datetimeval = cdate(datetimeval)
customdatetime = customdatetime & padder(month(datetimeval),2) & padder(day(datetimeval),2) & right(year(datetimeval),2)
customdatetime = customdatetime & replace(formatdatetime(datetimeval,4),":","")
customdatetime = customdatetime & mid(formatdatetime(datetimeval,3),instr(datetimeval," ")-1)
else
customedatetime = "ERROR-Input not valid datetime value"
end if
end function
function padder(value,length)
value = cstr(value)
length = cint(length)
for i=len(value) to (length-1)
value = "0" & value
next
padder=value
end function