Microsoft KB Archive/242257

From BetaArchive Wiki

Short Date Format Uses Two-Digit Year Instead of Four-Digit Year

Q242257



The information in this article applies to:


  • Microsoft Windows NT Server version 4.0
  • Microsoft Windows NT Workstation version 4.0





SYMPTOMS

If you configure a Windows NT 4.0 service that can run with no current user logged onto the computer, the number of digits used to display the year is not affected by the user profiles.



CAUSE

This issue occurs because when there is not a user logged on to the computer, the number of digits used to display the year are contained in the Locale.nls binary file, which also contains fixed values for such formats in all localized versions of Windows NT 4.0. The file is the same in all localized versions of Windows NT 4.0.



RESOLUTION

A supported fix is now available from Microsoft, but it is only intended to correct the problem described in this article and should be applied only to systems experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following address on the World Wide Web:


http://support.microsoft.com/directory/overview.asp

NOTE: In special cases, charges that are normally incurred for support calls may be canceled, if a Microsoft Support Professional determines that a specific update will resolve your problem. Normal support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English-language version of this fix should have the following file attributes or later:


   Date      Time      Size      File name    Platform
   ---------------------------------------------------
   9/22/99   12:25pm   146,832   locale.nls   x86 





STATUS

Microsoft has confirmed this to be a problem in Windows NT 4.0.



MORE INFORMATION

When a program uses the GetLocaleInfo function to retrieve date information, the function uses the short date format. You can configure each user profile to use either two or four digits to display the year in the short date format.

In C++, a common way to change a variant date value into a BStr data type is to use the ::VariantChangeType function. This function calls the GetLocaleInfo function and therefore uses the short date format.

Also, most date conversion code written in Microsoft Visual Basic calls the GetLocaleInfo function.

The problem usually only applies to a "displayed date", and your Visual Basic program uses the real date independently from what is displayed. However, this can be a real problem for every middle tier program that might return a date value. For example, an XML string that sends a result to a Web browser client or a client side Javascript string that runs and interprets a two-digit year its own way.

Client-side programs could depend on client-side user profiles for their interpretation of a two-digit year.

Microsoft recommends that you configure server programs that are running in the middle tier and return information to a client as text, use a four-digit year for all dates whenever you call the GetLocaleInfo function.

Additional query words:

Keywords : kbWinNT400PreSP7Fix
Issue type : kbbug
Technology : kbWinNTsearch kbWinNTWsearch kbWinNTW400 kbWinNTW400search kbWinNT400xsearch kbWinNTSsearch kbWinNTS400xsearch kbWinNTS400


Last Reviewed: May 18, 2001
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.