Date format vbLongDate ignores server's regional settings 
Author Message
 Date format vbLongDate ignores server's regional settings

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



Mon, 21 Jun 2004 18:48:37 GMT  
 Date format vbLongDate ignores server's regional settings
The web server runs under its own account. You'll have to change the
settings for that account (or the default regional settings).

--
You can't wake a person who is pretending to be asleep. -Navajo proverb

=-=-=
Steve
-=-=-


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



Mon, 21 Jun 2004 20:20:44 GMT  
 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



Tue, 22 Jun 2004 00:21:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Regional Date Settings Ignored

2. VBScript Date format- regional settings ?

3. reliable date formatting unrelated to regional settings

4. Date format and regional settings

5. How Can I Change the Short Date Format At Regional Settings in Control Panel

6. Setting the Regional Date and Time Settings.

7. Dates, MaskedBox, Regional settings and short date

8. Dates, MaskedBox, Regional settings and short date

9. Date formatted according to Client's Reggional Settings

10. How do I display dates in regional format

11. Displaying dates in regional format

12. IIS regional settings- incorrect VBscript date()

 

 
Powered by phpBB® Forum Software