When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips

Sections:
Sample Chapters
Commonly Asked Message Board Questions
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
XML Info
Information:
Feedback
Author an Article
ASP ASP.NET ASP FAQs Message Board Feedback
Print this page.
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!


ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article