Change the timezone in a VM

Change the timezone in a VM


Warning
Generally this is not something you want to do!

Consider the following: an Azure VM is allocated to you. This VM is not running locally, but runs in a Microsoft Azure Data Center. It is common practice to use UTC-time for cloud resources, this includes VMs. The time in the VM is reflecting the time of where the VM is located. Moreover, changing the time inside the VM is conflicting with several other items:
  1. Changing the time zone does not change the timestamp on the uploaded folders in Inbox. 
  2. Changing the time zone will be purely for the clock inside the VM, the auto shutdown function already functions according to the time zone you have set. For more information about the auto shutdown feature, please visit: Adjusting the auto-shutdown of a VM.

Azure Virtual Machines (VMs) are provisioned by Microsoft Azure in Coordinated Universal Time (UTC/UTC+0). Setting your time zone just by clicking the clock and changing the time zone often does not work or only works for a brief moment before reverting back to UTC. Moreover, it would also revert back to UTC when deallocating the VM. With the steps below you can set the time zone which will stick after deallocating the VM.

Info
You will need Owner rights to perform the steps below.
  1. Connect to a VM.
  2. Go to the startmenu and search for Windows Powershell.
  3. Right click on Windows Powershell > More > Run as Administrator.
  4. To list all the available timezones, type in the following command and Enter:
Notes
Get-TimeZone -ListAvailable
  1. Search for the timezone you want to change to and take note of the Id.
  2. Set the timezone by typing in the following command and Enter:
Notes
Set-TimeZone -Id "insert timezone here" > e.g. Set-TimeZone -Id "W. Europe Standard Time"