This is a discussion on "Date Format" within the Classic ASP section. This forum, and the thread "Date Format are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Date Format
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Date Format
I'm trying to return a date stored in the database as "07/13/2003", viewable as "July 13, 2003". Using the script below I get Saturday,July 13, 2003. I need to drop the day of the week.
<% response.write FormatDateTime(x_DOB,1) %> Substituting the "1" for another variable or using the long vb format does not correct the problem. My understanding is that "1" should return the format I want regardless of how the persons computer data format is set. Thanks ELK |
|
|
|
||||
|
I don't know why you are getting the day of the week, but it must be down to your regional settings (on the server)
I would split the date on the commas like this:-
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Are you using SQL?
If so, why not get SQL to return the correct date format. Much quicker than processing the string with ASP |
|
|||
|
<blockquote id="quote"><font size="1" face="geneva, verdana, arial" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by ekendricks
I'm trying to return a date stored in the database as "07/13/2003", viewable as "July 13, 2003". Using the script below I get Saturday,July 13, 2003. I need to drop the day of the week. <% response.write FormatDateTime(x_DOB,1) %> Substituting the "1" for another variable or using the long vb format does not correct the problem. My understanding is that "1" should return the format I want regardless of how the persons computer data format is set. Thanks ELK <hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote"> I tend to do this by using a function called "FriendlyDate" or something similar.. each date is then shown as FriendlyDate(theDate) Our function can then control date formatting, I just prefer this over letting regional settings etc determine how the date looks, and sometime I am short on space and want 1 Jun 2003 etc. Its fairly simple code to write the function. Let us know if you need example code. |
![]() |
| Tags |
| date, format |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| JS date format | joe3dge | JavaScript Forum | 0 | May 21st, 2007 00:11 |
| Changing date format in date picker | AdRock | JavaScript Forum | 1 | Aug 1st, 2006 17:16 |
| How to format date/time from input box ? | kahpeng | Classic ASP | 1 | Mar 27th, 2006 05:08 |
| Want Date Format in dd/mm/yyyy in ASP.Net With C#. | frmsasp | ASP.NET Forum | 1 | Nov 2nd, 2005 12:57 |
| date format help please | charter | Databases | 3 | Jun 14th, 2004 20:09 |