?
Solved

ASP VbScript Format Date

Posted on 2009-02-11
2
Medium Priority
?
787 Views
Last Modified: 2012-05-06
Dear Experts

I am returning a date record from a recordset into an update form.  as per code below.

The date displys correctly, however after the update it seems to change to US style MM/DD/YYYY.

Ideally I would like to display the date in the update form in the format mmm-dd-yyyy.  Is it possible to format the date this way in the form.

Thanks



<%=(enquiry.Fields.Item("eDate").Value)%>

Open in new window

0
Comment
Question by:grantballantyne
2 Comments
 
LVL 5

Accepted Solution

by:
synx earned 2000 total points
ID: 23611499
I'm not aware of a built-in format for mm-dd-yyyy (the FormatDateTime function doesn't allow that option from what I can see.  Details here: http://www.w3schools.com/VBscript/func_formatdatetime.asp#format)

I think you may need to do the formatting "manually."  Break the date into month, day, and year using the DatePart function, then concatenate them back together with '-' between them.  Here's an example:
http://psacake.com/web/fr.asp
0
 

Author Closing Comment

by:grantballantyne
ID: 31545547
thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question