Login :: Register
General Topics
An error has occurred.
Error: Sponsored By is currently unavailable.

2005 IIS MVPs
Other IIS Sites
  IIS5 is returning an incorrect date format (when I log on the web server), it is fine when I am not logged on! 

IIS5 is returning an incorrect date format (when I log on the web server), it is fine when I am not logged on!

I never really found out why IIS5 does this because IIS4 did not show this problem.

One way to fix this problem is to determine the Locale and force the web server to use it. I live in New Zealand and our locale is 5129 (&h1409).

By setting session.LCID in the global.asa file to 5129 I get the correct date format returned no matter what, but this is then hard coded to New Zealand, what about if I have a user from the USA or Japan, the dates should adjust for their locales.

sub session_onStart()
session.lcid = 5129 ' Set locale to New Zealand
end sub
When changing the locale it adjusts the VBScript Date, Time, Currency values that get returned to the user.

The following subroutine dynamically sets the Locale ID for the ASP application (Session.LCID) according to the Language settings supplied by the user's browser: