473,378 Members | 1,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Session.LCID changing has no effect

Hello,

My config : Windows 2003 x64 (US VERSION) + sp2, IIS 6
All regional settings to French (even for default user)
In my ASP pages dates are in the good format (french:dd/mm/yyyy), but
impossible to have US date format when i set the Session.LCID=1033
I did a simple test:
<%
ReturnDateTime 1033, "English (US)"
ReturnDateTime 1036, "French"
ReturnDateTime 2048, "English (UK)"
ReturnDateTime 3081, "English (Australia)"

Sub ReturnDateTime(locale, description)
Session.LCID = locale
Response.Write "<b>" & description & " (LCID = " & locale &
")</b><br>"
Response.Write "Long date: " & FormatDateTime(Date, 1) & "<br>"
Response.Write "Short date: " & FormatDateTime(Date, 2) & "<br>"
Response.Write "<p>" & FormatCurrency(1.05, 2) & "<br>"
Response.Write "<br>" & FormatNumber(1000000,2) & "<br></p>"
End Sub

%>

Results:

English (US) (LCID = 1033)
Long date: Monday 27 August 2007
Short date: 27/08/2007
1,05 €
1 000 000,00

French (LCID = 1036)
Long date: lundi 27 août 2007
Short date: 27/08/2007
1,05 €
1 000 000,00

English (UK) (LCID = 2048)
Long date: lundi 27 août 2007
Short date: 27/08/2007
1,05 €
1 000 000,00

English (Australia) (LCID = 3081)
Long date: Monday, 27 August 2007
Short date: 27/08/2007
$1.05
1,000,000.00

The English US format seems to be ignored.
If i change some settings for the french format (ex:decimal , to .),
changes are applied to the English US format too !!

I tried something else:
I set the server to English US and I apply regional settings to "all
settings to the current user account and to the default user profile".
I reboot and I logon as admin and set my regional settings to French but
NOT for the default user profile.
So i have in regestry hkey_users with English US and hkey_current_user
with French
Now i logon, and test my asp page i have the right values when setting
the Session.LCID.
But it's not a good solution, because i have to logon to get working.
Why it's not possible to get English US format when hkey_users &
hkey_current_user are set to french ?

I'm fed up with this problem.

Any help will be welcome.
Aug 27 '07 #1
0 3569

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Claudio Cezar | last post by:
I live in Brazil and i am trying to set my application to work with american date format. The problem is, even when i set the LCID property at the beginning of my code, it always returns the...
5
by: b_boy | last post by:
Hi all, I recently downloaded a calendar that i am trying out for a client. It works fine when i test it on my machine..however when i test it on the hosts server it can't handle the date format....
2
by: grw | last post by:
Trying to locate the list of valid lcid's on MS's site and googled. Ive toiled long and hard, but alas I cannot locate the information. (previous links moved) Could anyone point me in the...
0
by: David Patow | last post by:
Can anyone explain why neither ASP Session.LCID nor VBScript SetLocale() effect the locale of a VB6-based COM object that is instantiated via Server.CreateObject()? If I set Session.LCID, then...
0
by: Darren | last post by:
I used the following code on a server; <% ReturnDateTime 1033, "English (US)" ReturnDateTime 2057, "English (UK)" ReturnDateTime 3081, "English (Australia)" ReturnDateTime 1031, "German" ...
6
by: J. Baute | last post by:
I'm doing some tests to see if the Session.LCID can be used to easily change a user-dependant locale for number & date/time formatting in ASP. As far as I get the theory this should work, but I'm...
8
by: Rob | last post by:
Hi all, Is it possible to change the Session.LCID in a hyperlink? My problem is I'm calling a Date from a database to use as a querystring in the hyperlink but I also need to display the date as...
1
by: Hagge | last post by:
We are translating our web shop to Slovak but when I use Session.LCID=1051 for slovak do I get the error "Invalid LCID". The same shope use Swedish = 1053, Norwegian(Bokmal) = 1044, English = 1033...
0
by: ubi_comp | last post by:
Hi, I have a windows 2003 server IIS6 machine in development environment. I set Session.Lcid in aspx Page1 and move to aspx Page2 and use Session.Lcid value that I set in the Page1 without...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.