Set Time Zone With Tzutil In Windows From Command Line
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.
tzutil command can be get with
/? option like below.
$ tzutil /?
The usage syntax of tzutil is like below. We simply get current time zone or set a time zone.
TZUTIL </? | /g | /s TimeZoneID[_dstoff] | /l>
Get Current Time Zone
Windows systems current time zone information can be printed with
/g option like below.
$ tzutil /g
As we can see from output we are in
Arabic Standard Time which is equal to 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.
$ tzutil /l
The output provides the time zone name and the difference from 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.
$ tzutil /s "Arabic Standard Time"