Change Date Form DDMMYYYY to MMDDYYYY

A simple function to display the dates in MM/DD/YYYY format rather than in DD/MM/YYYY format.

<%
Function FormatDate(thedate)
Dim myDay
Dim myMonth
Dim myYear

myDay = Day(thedate)
If Len(myDay)=1 Then myDay="0" & myDay

myMonth = Month(thedate)
If Len(myMonth)=1 Then myMonth="0" & myMonth

myYear = Year(thedate)

FormatDate = myMonth & "/" & myDay & "/" & myYear
End Function

Dim dDate
dDate=Date()
Response.write FormatDate(dDate)
%>

Advertisements



MembersPro

MembersPro PayPal - ASP Membership software

Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.

Get your best asp web hosting provider now and save 25%