locked
VBScript Date () bug in WSH 5.7 RRS feed

  • Question

  • Hi folks

    I don't know if this is the correct forum for VBScript issues. 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 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 is an issue in both cscript.exe and wscript.exe.

    Is this a known issue?

    Regards
    Tony Longson. 

    • Moved by Riquel_Dong Wednesday, July 9, 2008 3:07 AM VB script issue is off-topic here
    Monday, July 7, 2008 12:28 PM

Answers