?
Solved

Response.write Date - Format question

Posted on 2003-02-21
10
Medium Priority
?
889 Views
Last Modified: 2011-10-03
My server is set to English (Australian) the short format date is dd/MM/yyyy

the long Format is dddd, d MMMM,yyyy

Yet when I do a response.write Date it comes up as

mm/dd/yyyy

Why ?

Id there anyway that I can force the .write Date function to be dd/MM/yyyy or preferably dddd, d MMMM,yyyy.

I have also tried the following
sTestDate=formatdatetime(Date,2)
response.write sTestDate

with no luck

Help would be appreciated
0
Comment
Question by:DCPAus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 

Expert Comment

by:hoinang
ID: 7997226
The following web site can help you about the date format.

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txtCodeId=7111
0
 

Author Comment

by:DCPAus
ID: 7997371
Hoinang

Have you used this code before ?

I get the following error

Microsoft VBScript runtime (0x800A01B0)
File name or class name not found during Automation operation: 'RegExp'
/oncall/FormatDate.asp, line 120

Any ideas ?
0
 

Author Comment

by:DCPAus
ID: 7997399
I found the following code not as complete as the code suggested by hoinang but adequate for my requirements

http://www.aspfree.com/authors/kevin_turner/datetime.asp

If anyone has some other suggestions I would love to see them

Thanks
DCPAus
0
Technology Partners: 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!

 
LVL 4

Expert Comment

by:Wakie
ID: 7997852
Hi DCP, try this:

<%
strDate = Day(Date) & "/" & Month(Date) & "/" & Year(Date)
Response.Write strDate
%>

Cheers,
Wakie.
0
 
LVL 1

Expert Comment

by:umangjoshi
ID: 7998635
sTestDate=formatdatetime(Date,1)
0
 

Author Comment

by:DCPAus
ID: 8045793
I duplicated this question.

The answer I acepted is
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20524722.html

0
 
LVL 4

Expert Comment

by:Wakie
ID: 8045838
Hi DCPAus,

I notice you gave the solution a grade of "B".

Is there any solutions in this question that have helped you more with your problem?

In my solution above, I use it myself as I also live in Australia. Have you tried it?

Regards,
Wakie.
0
 

Author Comment

by:DCPAus
ID: 8045891
Hi Wakie

My problem related to more than just displaying the date in the correct format, but also dealing with the way I call and resave data into my dbase.

It is an issue that has been bugging me for weeks, and in essence none of the answers "solved" my problem - possibly I did not define it adequately, but some of them helped guide me in the write direction.

For instance your suggestion was one of my original solutions when I started the process.

I actually use a small dll written to the server that controls a variety of functions on my pages, and in it I have a function that does exactly that it extracts the day/month/year info and then rearranges it in whichever format I require.


So what I have now done is used the LCID info to control the date viewed data and I have "solved" - still nervous about it - the problem by ensuring that when I write/rewrite info to the database I encapsulate it in # # and so far - cross fingers it appears to be working.

I have read your member info, as well, and since you are an EE expert if you have any other advice to give me with regards to awarding and posting please feel free

Regards
DCP
0
 
LVL 4

Expert Comment

by:Wakie
ID: 8046029
Hi DCP,

No problem there. I, personally, haven't tried any other solutions for my date/time formats other than what I suggested. I must admit, it took a long time to get it perfected. I've noticed the Day(Now) and Month(Now) commands often result in outputting the results back to front, especially when you use that method. It's a shame there isn't an easier way to personalise the dates for us Aussies :-)

I've actually written a pretty hand GMT converter - it converts the month/date to date/time and also allows you to personalise the time for your timezone. But, I won't ramble.

If you wish to claim a refund on your points for this question, you can post a zero-point question at Community Support (http://www.experts-exchange.com/Community_Support/).

Best of luck,
Wakie.
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 8046641
Points refunded and question closed.

Netminder
EE Admin
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

770 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