Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Response.write Date - Format question

Posted on 2003-02-21
10
Medium Priority
?
892 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
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

577 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