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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp date formatting

Status
Not open for further replies.

sweetleaf

Programmer
Jan 16, 2001
439
CA
Hi there!

How do i print the following recordset Date to screen in Long format(mm/dd/yyyy) rather than short format:

<% Response.Write (rst(&quot;CYCLE_APPL_START_DAY&quot;) & &quot;</BR>&quot;)%>

The machine that the web server is on has its regional settings set to short date (m/d/yy) and i hav no control over the server settings.

any help is GREATLY appreciated!
 
sweetleaf,

Just use the following:

formatDateTime(rst(&quot;CYCLE_APPL_START_DAY&quot;), 1)

The &quot;1&quot; signifies long date format. Mise Le Meas,

Mighty :)
 
hey Mighty!

Thanks bud but I've tried that already and I got
&quot;Thursday October 15, 2001&quot; rather than simply &quot;10/15/2001&quot;
I think i may just alter my sql in the com object rather than deal with DATE-FORMATTING on the actual ASP.

cheers
 
formatDateTime(rst(&quot;CYCLE_APPL_START_DAY&quot;), 2)

is what you're looking for -- vbShortDate is the constant enum (if you have included your adovbs.inc file)

:)
Paul Prewett
penny.gif
penny.gif
 
sweetleaf,

If you want to display the date in the mm/dd/yyyy format then you can just do the following:

' Make sure it's in date format
myDate = formatDateTime(rst(&quot;CYCLE_APPL_START_DAY&quot;))

myLongDate = month(myDate) & &quot;/&quot; & day(myDate) & &quot;/&quot; & year(mydate)

response.write myLongDate
Mise Le Meas,

Mighty :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top