Date Format

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.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 22nd, 2003, 20:58
Junior Member
Join Date: Aug 2003
Location: USA
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
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

  #2 (permalink)  
Old Aug 23rd, 2003, 08:00
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
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:-

Code: Select all
<%
datearray = Split(formatdatetime(now(),1),",")
myDate = datearray(1) & datearray(2)
Response.write myDate
%>
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #3 (permalink)  
Old Aug 26th, 2003, 16:37
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Are you using SQL?
If so, why not get SQL to return the correct date format. Much quicker than processing the string with ASP
  #4 (permalink)  
Old Sep 1st, 2003, 17:03
Junior Member
Join Date: Sep 2003
Location: Vatican City
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
<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.
Closed Thread

Tags
date, format

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 15:35.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43