470,636 Members | 1,575 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

LCID and Date format

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

Jul 19 '05 #1
4 12519
> 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...
Jul 19 '05 #2

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:uA**************@tk2msftngp13.phx.gbl...
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...


I'm afraid not :o(
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.
Jul 19 '05 #3
> is the backup software installed by the hosting provider.

So have you asked the hosting provider about this??
Jul 19 '05 #4

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:OZ**************@TK2MSFTNGP11.phx.gbl...
is the backup software installed by the hosting provider.


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
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Claudio Cezar | last post: by
5 posts views Thread by b_boy | last post: by
reply views Thread by A_Dude | last post: by
2 posts views Thread by A_Dude | last post: by
2 posts views Thread by J. Baute | last post: by
2 posts views Thread by Just4U | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.