How can I change the short date format from yy to yyyy?

John Savill

March 4, 1999

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. Due to Year 2000 concerns you may want the NT short date format toshow 4 digit years as opposed to the short 2 digit version. The normal methodis as follows:

  1. Start the Regional Control Panel Applet (Start - Settings - Control Panel -Regional)

  2. Select the Date tab

  3. Select 'M/d/yyyy' and click Apply

  4. Click OK

  5. Close the dialog

All this actually does is set the registry entry HKEY_CURRENT_USERControlPanelInternationalsShortDate and so you can use this to automate the update.For example using the REG.EXE utility, e.g.

C:> reg update "HKCUControlPanelInternationalsShortDate=M/d/yyyy"

This could be incorporated in a login script or even a custom system policy.

You will also notice under the registry key the long date format can be setby changing sLongDate.

An alternate solution to set for new systems is by using an unattendedinstallation, make the sShortDate change as part of the CMDLINES.TXT setup.This is then adopted by admin and any new accounts created on the workstation.Sample code:

***** CMDLINES.TXT *****
"rundll32 setupapi InstallHinfSection DefaultInstall 128 .y2k.inf"
***** EOF ********

*** y2k.inf ***
[Version]
Signature="$Windows NT$"

[DefaultInstall]
AddReg=AddReg

[AddReg]
HKU,".DEFAULTControlPanelInternational","sShortDate",,"M/d/yyyy"
*** EOF ***

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like