|
Subject:
|
formatting date time
|
|
Posted By:
|
Adam H-W
|
Post Date:
|
9/28/2004 5:43:39 AM
|
Hi there
Can anyone tell me the code for formatting the date so that it outputs like so:
September 28, 2004
At the moment it's outputting like this:
Tuesday, September 28, 2004
and I'm using (formatDateTime(myDate,1))
thanks alot
|
|
Reply By:
|
ChrisScott
|
Reply Date:
|
9/28/2004 10:30:58 AM
|
Hi Adam,
This should do what you're after
Function MyDateFormat(pDate)
Dim months: months = Array("January", "February", "March", "April", "May", "June", _
"July", "August", "September", "October", "November", "December")
MyDateFormat = months(Month(pDate) - 1) & " " & Day(pDate) & ", " & Year(pDate)
End Function
HTH,
Chris
|
|
Reply By:
|
Adam H-W
|
Reply Date:
|
9/28/2004 1:46:39 PM
|
thanks Chris
|
|
Reply By:
|
mat41
|
Reply Date:
|
9/28/2004 7:28:21 PM
|
Adam H-W
No real need for the array if you want to minimize your code, try this:
-------------cut n paste-------------------- <%= monthName(Month(Date)) & " " & DatePart("d", date) & ", " & DatePart("yyyy", date) %> -------------finish------------------------
Wind is your friend Matt
|
|
Reply By:
|
Adam H-W
|
Reply Date:
|
9/29/2004 3:35:01 AM
|
thanks guys - sorted.
|