Hi folks
I've recently updated my XP laptop to SP3 which has uplifted WSH to v5.7 and
this has introduced a bug regarding the Date () function. When the result is
being converted to a string, it doesn't use the correct local format, but
seems to default to US format instead. Here in the UK the standard format is
DD/MM/YYYY. Here is some example code:
WScript.Echo Date ()
WScript.Echo â??â?? & Date ()
WScript.Echo CStr (Date ())
Under 5.6 this produces the correct output:
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
04/07/2008
04/07/2008
04/07/2008
Under WSH 5.7 the output is:
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
04/07/2008
7/4/2008
7/4/2008
This happens in both cscript.exe and wscript.exe.
Is this a known bug? The main problem I have with it is that any WMI queries
using the date either fail or return the wrong data.
Regards
Tony Longson.