Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date() 1

Status
Not open for further replies.

OhioSteve

MIS
Mar 12, 2002
1,352
US
I know that date() returns the system date. For example, today it returns "7/16/2004". However, I want "July 16, 2004". What is the specific syntax for changing the output format?
 
This should get you started:
Code:
Response.Write FormatDateTime(Date(), vbGeneralDate)
Response.Write FormatDateTime(Date(), vbLongDate)
Response.Write FormatDateTime(Date(), vbShortDate)
Response.Write FormatDateTime(Date(), vbLongTime)
Response.Write FormatDateTime(Date(), vbShortTime)

Response.Write Mid(FormatDateTime(Date(), vbLongDate), _
    InStr(FormatDateTime(Date(), vbLongDate), ", ") + 2)

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Try this:

<%=MonthName(Month(Date))%> <%=Day(Date)%>,<%=Year(Date)%>


-VJ
 
Amorous, a variation on your suggestion worked.

elegantDate= MonthName(Month(Date())) & " &nbsp;" & Day(Date) & ",&nbsp;" & Year(Date)
 
or you could use at the top of the pages

Code:
session.LCID = LCID Number

to set the date format

LCID Codes



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top