通过命令提示符更改日期和时间格式 [英] Change date and time format via command prompt

查看:125
本文介绍了通过命令提示符更改日期和时间格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道,在Windows 7及更高版本中,是否可以更改通过命令提示符显示日期和时间的方式?是的,我在美国,但我喜欢用欧洲的方式做事:

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)

短日期:设置为 d / M / yyyy

Short Date: Set as "d/M/yyyy"

长日期:设置为 dddd,d MMMM yyyy

Long Date: Set as "dddd, d MMMM yyyy"

短时间:设置为 HH:mm

Short Time: Set as "HH:mm"

长时间:设置为 HH:mm:ss

Long Time: Set as "HH:mm:ss"

推荐答案

是的,例如使用 reg add 命令
检查 HKEY_CURRENT_USER\控制面板\国际注册表项:

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"

例如,查询短时间格式:

reg query "HKCU\Control Panel\International" /V sShortTime

并将其设置为所需值:

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

这篇关于通过命令提示符更改日期和时间格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆