tzutil时区选项_在Windows中从命令行在Tzutil中设置时区

tzutil时区选项

tzutil时区选项

Time and date configuration is very important for servers. Some logs and security rules are tied with date and time information. In windows environments this information can be set with different tools and ways. Powershell, GUI or command line MS-DOS can be used to set time and date information. In this tutorial we will look tzutil which is a MS-DOS command line tool used to configure date time in Windows systems.

时间和日期配置对于服务器非常重要。 一些日志和安全规则与日期和时间信息绑定在一起。 在Windows环境中,可以使用不同的工具和方式来设置此信息。 Powershell,GUI或命令行MS-DOS可用于设置时间和日期信息。 在本教程中,我们将看到tzutil ,它是用于在Windows系统中配置日期时间的MS-DOS命令行工具。

帮帮我 (Help)

Help about tzutil command can be get with /? option like below.

可以使用/?获得有关tzutil命令的帮助/? 如下所示的选项。

$ tzutil /?
Help
Help
帮帮我

句法(Syntax)

The usage syntax of tzutil is like below. We simply get current time zone or set a time zone.

tzutil的用法语法如下所示。 我们只需获取当前时区或设置一个时区即可。

TZUTIL </? | /g | /s TimeZoneID[_dstoff] | /l>

获取当前时区 (Get Current Time Zone)

Windows systems current time zone information can be printed with /g option like below.

Windows系统当前时区信息可以使用/g选项打印,如下所示。

$ tzutil /g
Get Current Time Zone
Get Current Time Zone
获取当前时区

As we can see from output we are in Arabic Standard Time which is equal to GMT+3

从输出中可以看到,我们使用的是Arabic Standard Time ,等于GMT + 3

列出可用时区 (List Available Time Zones)

While changing the time zone we should provide the time zone full name. This time zone name can be difficult to find and write. So we can list all available time zones with /l option like below.

在更改时区时,我们应提供时区全名。 此时区名称可能很难找到和写入。 因此,我们可以使用/l选项列出所有可用的时区,如下所示。

$ tzutil /l
List Available Time Zones
List Available Time Zones
列出可用时区

The output provides the time zone name and the difference from UTC

输出提供时区名称和与UTC的时差

设定时区(Set Time Zone)

Now as a little tutorial we are at the end of the tutorial with most exiting operation. We will change the windows server default time zone with the /s option by providing new time zone name. In this example we will set the new time zone as Arabic Standard Time . The list can be get from previous step to select a time zone.

现在,作为一个小教程,我们将在本教程的结尾处进行大部分退出操作。 通过提供新的时区名称,我们将使用/s选项更改Windows服务器的默认时区。 在此示例中,我们将新时区设置为“ Arabic Standard Time 。 可以从上一步中获得该列表以选择时区。

$ tzutil /s "Arabic Standard Time"
LEARN MORE  Javascript Date Types and Functions
了解更多Javascript日期类型和函数

翻译自: https://www.poftut.com/set-time-zone-tzutil-windows-command-line/

tzutil时区选项

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值