User Tip: A Date Convertion Function
From Rob:
Just thought I'd share my date formatting function, just re-arrange the DateConvert
result to get the date in the order you prefer. Simple!
<%
Function DateConvert(MyDate)
Dim strDay
Dim intDate
Dim strMonth
Dim intyear
Dim intHour
Dim intMinute
Dim intSecond
Dim WDay
Dim MMonth
Dim int2digyear
WDay = WeekDay(MyDate)
MMonth = Month(MyDate)
strDay = WeekDayName(Wday)
intDate = Day(MyDate)
strMonth = MonthName(MMonth)
intYear = Year(MyDate)
intHour = Hour(MyDate)
intMinute = Minute(MyDate)
intSecond = Second(MyDate)
int2digyear = Right(intYear,2)
if Len(intMinute) < 2 then
intMinute = ("0" & intMinute)
end if
if Len(intSecond) < 2 then
intSecond = ("0" & intSecond)
end if
DateConvert = " " & strDay & ", " & _
intDate & " " & strMonth & " " & _
int2digyear & " - " & Inthour & _
":" & IntMinute & ":" & intSecond & " "
End Function
%>
|
Happy Programming!