I was just wondering, in Windows 7 and above, is it possible to change the way dates and times are displayed via the command prompt? Yes, I'm in the U.S. but I like doing things the European way:
(In Clock/Language/Region)
Short Date: Set as "d/M/yyyy"
Long Date: Set as "dddd, d MMMM yyyy"
Short Time: Set as "HH:mm"
Long Time: Set as "HH:mm:ss"
Type "time" into the command prompt window and press "Enter." The current time setting will now display. To change it, type the proper time into the window in the "00:00:00" 24-hour format -- for example, "13:30:00" for 1:30 p.m. -- and press "Enter." The new time will now be saved.
Though counterintuitive, the Linux “date” command displays the time, as well as the date, on a Linux box. You can set the date and time on your Linux system clock using the “set” switch along with the “date” command. Note that simply changing the system clock does not reset the hardware clock.
Click the C:\ icon in the upper-left corner of the command prompt window. From the drop-down menu, click the setting for Properties. From the Properties window, click the Layout tab.
Yes, it's possible e.g. using reg add
command.
Check the HKEY_CURRENT_USER\Control Panel\International
registry key:
reg query "HKCU\Control Panel\International"
For instance, query Short Time format:
reg query "HKCU\Control Panel\International" /V sShortTime
and set it to desired value:
reg add "HKCU\Control Panel\International" /V sShortTime /T REG_SZ /D HH:mm /F
If value name or data contains spaces, use double quotes (surrounding double quotes would not be written to registry):
reg add "HKCU\Control Panel\International" /V sShortTime /T REG_SZ /D "HH:mm" /F
A word of warning: Changing this registry value changes the settings in the user's profile, so it may have side effects in other areas. For example the way the clock is displayed in the task bar. And maybe it breaks other scripts that expect another time/date format.
So be careful when using this trick in something which you give to others!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With