LCID and Date format

C

Chopper

I realise this question has been raised many times but I am still no wiser
as to why setting the locales will not work in my ASP application. I have
searched on google groups etc. and tried numerous solutions to no avail.

Basically, I am trying to get ASP to output the dates in the UK Format but
nothing seems to work.
1.I have tried setting Session.LCID to 2057 in both session onstart,
individual pages and the language declaration at the top of pages.
2.I have checked the locale settings in the regional settings on the server
and for some reason the short date format was M/dd/yyyy (despite being set
to UK) so I amended that and had the server rebooted.
3.I don't have the duplicate locale entries in the registry that someone
else said caused problems for them.
4.I am pulling the date from a SQL DB as well as putting <%=now()%> on the
page but the results are the same.
5.After setting the LCID I have got the page to output the LCID to prove it
has been set.

I have also looked at the www.aspfaq.com site and tried the example code at
the top of: http://www.aspfaq.com/show.asp?id=2260
These are the results:
English (US) (LCID = 1033)
Long date: Monday, November 17, 2003
Short date: 11/17/2003
English (UK) (LCID = 2057)
Long date: 17 November 2003
Short date: 11/17/2003 ***(WHY???)***
English (Australia) (LCID = 3081)
Long date: Monday, 17 November 2003
Short date: 17/11/2003
German (LCID = 1031)
Long date: Montag, 17. November 2003
Short date: 17.11.2003

I've tried other things also, but cannot remember them at this moment.

I have considered going through and formatting the date myself but although
it will solve the problem for this particular application I really want to
know what the issue is so that I can fix it rather than work around it.
I am using Windows 2000 Server (IIS 5) which was installed by the hosting
provider.

Any ideas/help is much appreciated.

chopper
 
A

Aaron Bertrand - MVP

2.I have checked the locale settings in the regional settings on the
server
and for some reason the short date format was M/dd/yyyy (despite being set
to UK) so I amended that and had the server rebooted.

So, is it still m/dd/yyyy? I would bet it is. There might be some software
installed that is forcing this...
 
C

Chopper

Aaron Bertrand - MVP said:
So, is it still m/dd/yyyy? I would bet it is. There might be some software
installed that is forcing this...

I'm afraid not :eek:(
Since the reboot I've checked the date formats and they are all correct:
Short date sample: 17/11/2003
Short date format: dd/MM/yyyy (this is what I changed it to pre-reboot)
Long date sample: 17 November 2003
Long date format: dd MMMM yyyy

There is no additional software installed on the server except for what I
believe is the backup software installed by the hosting provider.
 
A

Aaron Bertrand - MVP

is the backup software installed by the hosting provider.

So have you asked the hosting provider about this??
 
C

Chopper

Aaron Bertrand - MVP said:
So have you asked the hosting provider about this??

I got in touch with the hosting provider and the problem is now solved.
They changed a registry entry:
(HKEY_USERS/.DEFAULT/Control Panel/International/sShortDate) value to
dd/MM/yyyy
Unfortunately they didn't tell me why this was invalid in the first place.
I can only assume this is the entry changed by setting the short date format
in the regional settings control panel. I guess it was incorrectly set at
install of the OS or subsequent applications.

Many thanks for your help Aaron.

chopper
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top