Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Set TimeZone in Windows via CMD and PowerShell

Setting the correct time zone on your Windows machine is crucial for ensuring that your system time is accurate. This can be particularly important for scheduled tasks, logging, and other time-sensitive operations. In this article, we will explore how to set the time zone in Windows using both Command Prompt (CMD) and PowerShell.

Using Command Prompt (CMD)

To set the time zone via Command Prompt, you need to use the tzutil command, which is a built-in utility for managing time zones in Windows.

Step-by-Step Guide:

  1. Open Command Prompt as Administrator:

    • Press Win + X and select "Command Prompt (Admin)" or "Windows PowerShell (Admin)".
  2. List Available Time Zones:

    • To see a list of all available time zones, use the following command:
      tzutil /l
    • This will display a list of time zones with their corresponding names.
  3. Set the Time Zone:

    • To set the time zone, use the following command:
      tzutil /s "Time Zone Name"
    • Replace "Time Zone Name" with the desired time zone from the list. For example, to set the time zone to Pacific Standard Time, you would use:
      tzutil /s "Pacific Standard Time"

Example:

tzutil /s "Pacific Standard Time"

Using PowerShell

PowerShell provides a more flexible way to manage system settings, including the time zone.

Step-by-Step Guide:

  1. Open PowerShell as Administrator:

    • Press Win + X and select "Windows PowerShell (Admin)".
  2. List Available Time Zones:

    • To list all available time zones, use the following command:
      Get-TimeZone -ListAvailable
    • This will display a list of time zones with their IDs and display names.
  3. Set the Time Zone:

    • To set the time zone, use the following command:
      Set-TimeZone -Id "Time Zone ID"
    • Replace "Time Zone ID" with the desired time zone ID from the list. For example, to set the time zone to Pacific Standard Time, you would use:
      Set-TimeZone -Id "Pacific Standard Time"

Example:

Set-TimeZone -Id "Pacific Standard Time"

Additional Tips:

  • Verify Current Time Zone:

    • You can verify the current time zone using the following commands:
    • CMD:
      tzutil /g
    • PowerShell:
      Get-TimeZone
  • Automating Time Zone Setting:

    • You can include these commands in a script to automate the process of setting the time zone on multiple machines.

Conclusion

Setting the time zone on a Windows machine is a straightforward task that can be accomplished using either Command Prompt or PowerShell. By following the steps outlined above, you can ensure that your system time is accurate and synchronized with the correct time zone.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.