I am a little confused about what the VBScript setLocale function does in ASP.
I'm changing the locale from 1033 (US english) to 3081 (Aust English) which should change the date format from mm/dd/yyyy to dd/mm/yyyy
Session.LCID changes what is returned from getLocale as does setLocale. But only the session.LCID actually change what the date output looks like!
Here is some code:
Code:
<html>
<head>
<title></title>
</head>
<body>
getLocale(): <%= getLocale() %><br>
now() <%= now() %><br>
setLocale(1033): <%= setLocale(1033) %><br>
getLocale(): <%= getLocale() %><br>
now() <%= now() %><br>
setLocale(3081): <%= setLocale(3081) %><br>
getLocale(): <%= getLocale() %><br>
now() <%= now() %><br>
</body>
</html>
getLocale(): 3081
now() 25/02/2003 12:10:02 PM
setLocale(1033): 3081
getLocale(): 1033
now() 25/02/2003 12:10:02 PM
setLocale(3081): 1033
getLocale(): 3081
now() 25/02/2003 12:10:02 PM
Here is the work around and output that I would expect from the above!
Code:
<html>
<head>
<title></title>
</head>
<body>
getLocale(): <%= getLocale() %><br>
now() <%= now() %><br>
Session.LCID = 1033: <% Session.LCID = 1033 %><br>
getLocale(): <%= getLocale() %><br>
now() <%= now() %><br>
Session.LCID = 3081: <% Session.LCID = 3081 %><br>
getLocale(): <%= getLocale() %><br>
now() <%= now() %><br>
</body>
</html>
getLocale(): 3081
now() 25/02/2003 12:11:10 PM
Session.LCID = 1033:
getLocale(): 1033
now() 2/25/2003 12:11:10 PM
Session.LCID = 3081:
getLocale(): 3081
now() 25/02/2003 12:11:10 PM
Can anybody verify my results or explain why this happens?
I'm using IIS5 on Windows2000. My Os locale is 3081