Categories: System Configuration

Set time zone from command line (CMD)

Time zone setting allows us to set the time according to the geographical location the computer is located at. We can change the time zone of a computer in Date and Time properties window which can be opened by running timedate.cpl from Run window.

Few readers of the blog have put this question to me. Is it possible to set the time zone from command line? 

The answer varies depending on which Windows edition you have. In Windows 11 and Windows 10, we have a command called tzutil using which we can easily change time zone from Windows command line. In Windows 11 and Windows 10, it’s bit complicated.

Windows 11 and Windows 10

You can run the below command to set timezone in Windows 11 and Windows 10.

tzutil /s  "Time zone Identifier"

Examples:

Command to set time zone to Pacific Standard Time:

tzutil /s "Pacific Standard Time"

Command to set time zone to Central America standard time:

tzutil /s "Central America Standard Time"

Get the current time zone

We can find the current time zone by running the following command.

tzutil /g

Example:

c:>tzutil /g
Pacific Standard Time
c:>

Get the list of time zones

Run the command ‘tzutil /l‘ to get the list of time zones available.

Windows 11 and Windows 10/Server 2003

While searching for a solution to this problem I got to know that there is a Windows Resource kit tool called timezone.exe which can be used to change day light savings..It does not set time zone. I tried further to find if there is any registry hack and below is what I came up with.

I found that the below registry key stores the information about different time zones.  

HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionTime Zones.

There is another registry key HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTimeZoneInformation which has information about the current time zone.  This registry has the following information on my computer.

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTimeZoneInformation
Bias        REG_DWORD       0x1e0
StandardName        REG_SZ  Pacific Standard Time
StandardBias        REG_DWORD       0x0
StandardStart       REG_BINARY      00000B00010002000000000000000000
DaylightName        REG_SZ  Pacific Daylight Time
DaylightBias        REG_DWORD       0xffffffc4
DaylightStart       REG_BINARY      00000300020002000000000000000000
ActiveTimeBias      REG_DWORD       0x1e0

Now it’s clear that in order to change the time zone we need to put right data in these registry values.

Now the question is how to get these values for the time zone you want to set? It’s very simple. You just need to set the time to your desired time zone using GUI (timedate.cpl) and then capture the registry values by exporting the registry key TimeZoneInformation to a reg file.   Whenever you want to set the time zone from command line just run the exported .reg file and then reboot the machine to make the changes effective.  You can run the .reg command from a batch file also.

The above method works for all Windows versions – Windows 11 and Windows 10, Server 2003 and Server 2008.

There’s another method in circulation for setting time zone from command prompt.

RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Central Standard Time

When I had tested the command on earlier Windows releases, I found that it does not work for all the timezones. In Windows 11 and Windows 10, it does not work at all. It just opens the time and date configuration window.

Srini

View Comments

  • hi there,

    I have a lot of servers with windows server 2003 to which the clock must move forward or backward one hour due to daylight saving time changes. I need you to help me with a command either powershell or cmd to save a scheduled time change task. In spring - summer the time zone is at (GMT-03: 00) Santiago but in autumn - winter the time zone should be at (GMT-04: 00) Georgetown, La Paz, Manaus, San Juan

    tzutil does not work on windows server 2003

  • For Windows:
    Use "tzutil /l" command which prints out every valid timezone in the system (cities will be included as well)

    After you decided which is the correct timezone for you, copy the rigth one from tzutil /l output behind "tzutil /g" command.
    Use "tzutil /?" for further usage details

    You may also use or "systeminfo | findstr /L “Zone:”" to check your current settings, but the mentioned tzutil/g will also do the job.

    When you want to check your system logs, do not forget that these changes will be also applied on your system logging information (kind of obvious, but you might not keep this in mind on your vacation).

  • What if I just wanted to get the timezone of the currentdate in London ? My friend share me this code in UNIX TZ=Europe/London date +%Z but I need the cmd command

  • RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Atlantic Standard Time

    Worked great for Windows Server 2003!

  • Thanks a ton guys..
    saved my time.Really helpfull.

    I had to do for around 50 machiens.with the Psexec and the command mentioned above i was able to do it with Ease.

    Ram

  • or, just found out ---> you can use the tzutil.exe in Windows 7.

    tzutil /s "gmt standard time"

    Changes the time zone to gmt and changes are instant.

    Hope this helps.

  • Hi,

    Your solution of changing time zone works very nicely. But to reflect changes made in registry we have to restart the machine. Is there anyway to immediately reflect updated timezone change setting without reboot ?

    Thanks

  • CONTROL.EXE TIMEDATE.CPL,,/Z W. Europe Standard Time
    y tests showed that this does not work if you use the names that are shown in the XP timezone dialog. It seems that those are only display names.
    When I used the names for the subkey of
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones
    it worked well. Those names are all English and it seems that XP needs that.

Recent Posts

Manage Print Jobs in Windows 11 & 10 Using PowerShell

Use PowerShell to list, pause, resume, and cancel print jobs in Windows 11 and Windows…

4 days ago

Add New User Account from Command Prompt (CMD)

Create local or domain user accounts from Command Prompt in Windows 11 and Windows 10…

4 years ago

Delete directory from command line [Rmdir]

Do you want to delete a directory from Windows Command Prompt (CMD)? This post explains…

4 years ago

TaskKill: Kill process from command line (CMD)

We can kill a process from GUI using Task manager. If you want to do…

4 years ago

Kill Chrome from command line

Chrome is definitely the stable browser compared to other ones and it has been my…

4 years ago

Find Windows OS version from command line

Windows has multiple command line utilities that can help find the version of the Windows…

4 years ago