
Date format vbLongDate ignores server's regional settings
INFO: Behavior of Date/Time Format Differs When Accessed from Active Server Pages (Q306044)
http://support.microsoft.com/support/kb/articles/Q306/0/44.asp?SD=MSD...
Regional settings are per user...
An ASP running under the IUSR/IWAM_machinename account is not a typical "user". In that context, the regional settings are taken from
HKEY_USERS\.DEFAULT\Control Panel\International
A real user actually logged on to the server as an interactive user gets regional settings from
HKEY_CURRENT_USER\Control Panel\International
which is unique to that user and can be changed independently from any other user. The first time a real user logs on the HKCU branch gets its initial values from
HKEY_USERS\.DEFAULT\Control Panel\International
just like IUSR/IWAM_machinename with the difference being that a real user's regional settings changes are persistent after they log off.
So the bottom line is, customize the HKEY_USERS\.DEFAULT\Control Panel\International branch in the registry and that's what an ASP page will use...
--
Michael Harris
Microsoft.MVP.Scripting
--
Quote:
> I'm using two web servers, both set up with the same long date format set in
> the control panel under 'Regional Settings'. Both say dd MMMM yyyy. Both are
> uk based, with 'your locale' correctly set.
> I'm using FormatDateTime(mydate,vbLongDate) and getting two different
> results on the servers: the correct one gives "03 January 2002". The
> incorrect one gives "Thursday, January 03, 2002"
> What gives? Have I missed something obvious? Both servers are Win2000 SP2.
> Ta muchly.
> Pugwash