 |
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

September 28th, 2004, 05:43 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
formatting date time
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
|

September 28th, 2004, 10:30 AM
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi Adam,
This should do what you're after
Code:
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
|

September 28th, 2004, 01:46 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks Chris
|

September 28th, 2004, 07:28 PM
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
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
|

September 29th, 2004, 03:35 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks guys - sorted.
|
|
 |