regional settings inconsistency

J

Janette

Hi,

I have done a lot of reading before doing this posting, but I just can't
find a solution that makes sense.

eg http://support.microsoft.com/default.aspx/kb/306044 - Behavior of
Date/Time format differs when accessed from Active Server Pages
and http://support.microsoft.com/kb/264063/ - VBScript Date and Time
Functions May not be Formatted Properly in Non-English (US) Locales

I have a production ASP based website running on Windows2000 server. I am
trying to migrate it to another Windows2000 server manually. All is working
except the regional settings. I have checked the HKEY_USERS\.DEFAULT\Control
Panel\International settings and they are the same between servers. But when
I run the application the use of now() in the vbscript is giving the wrong
date format. I am at a complete loss. Everything I have read points me to
this registry setting being used by IIS for getting the regional settings,
but it is not working.

If it were a new application I would just be more explicit and use datepart
to put together the values I require, but this application has been running
successfully for over 4 years and I am afraid I will miss somewhere and it
will not be found for a long while.

Can anyone suggest where else I should check, eg somewhere in the IIS setup,
in order to fix this problem.

Is it possible there is some patch I might be missing after Win2000 Service
Pack 4 that addresses this?

Thanks in advance
Janette
 
J

Janette

Just another curious addition. I coded

response.write(getlocale())

into a page and got the result 1033, where it should be 3081 according to
the registry setup.

I then coded

setlocale(3081)
response.write( getlocale() & "<br>")
response.write( now())

and now() still gives the 1033 format. I was sure this should have fixed it.

Very confused
Janette
 
L

Luke Zhang [MSFT]

Hello Janette,

In Control panel\regional and language Options, you may change the locale
and Date Time format here. After the changes, you may perform a reboot and
test your ASP page again, will it give correct result after this?

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Janette

Hi Luke,

Firstly, the settings are correct in the control panel/regional and
langauage Options, but yes I have tried this, tried rebooting and stopping
and starting IIS and have had no change.

Regards
Janette
 
L

Luke Zhang [MSFT]

Hello Janette,

In you test code:

setlocale(3081)
response.write( getlocale() & "<br>")
response.write( now())


If you replace the "setlocale(3081)" with :

Session.LCID = 3081

With this give correct output for date time string?

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Janette

Hi Luke,

I tried using Session.LCID = 3081 and it works. I still don't understand
1. Why Session.LCID works and setlocale(3081) doesn't
2. Why I need to set Session.LCID = 3081 at all when this code on my old
server correctly picked up the server default for the locale.

Anyway, thanks, I will just have to run with this solution for now, as I
have no alternative.
Regards
Janette
 
L

Luke Zhang [MSFT]

Hello Janette,

Based on my experience, Session.LCID is right working way in an ASP page;
setlocale() is intend to work in VBScript application. For example, a .vbs
file.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top