8

How to change the time zone from UTC to Arabian Standard Time in Azure virtual machine running the windows server?

Mohammed
  • 193
  • 2
  • 2
  • 9
  • The virtual machine behaves like any other virtual machine and you can change its settings e.g. by remoting into it. See e.g. https://www.faqforge.com/windows-server-2016/change-server-name-date-time-time-zone-server-2016/ for details on how to do it. – kim Mar 15 '18 at 11:51

3 Answers3

7

I'm afraid that you would not be able to change the time Zone actually. Even if you changed it onece, the time zone would revert to UTC after restarting.

Also, changing the time zone for Azure IaaS VM is not recommended.

While it may be very tempting to change the server time on the Azure Virtual Machines using a startup task, it is not recommended, you should rather use methods like TimeZoneInfo.ConvertTimeFromUTCTime in your code.

You can also check this blog for more details about the TimeZone on Azure.

Hope this helps!

Wayne Yang
  • 9,016
  • 2
  • 20
  • 40
6

Azure simply offers to set regional (timezone) selection during VM Provisioning! one can refer this https://learn.microsoft.com/en-us/previous-versions/azure/dn495299(v=azure.100)

Furthermore, if you want to change time after VM provisioning then can use Set-TimeZone -Id "Time Zone Id" To get your time zone use Get-TimeZone -ListAvailable powershell command.

Although, time would never set back itself to UTC time zone. But if it is so then you must use Azure Desired State Configuration. This helps to make changes persistent. please refer Azure Desired State Configuration for more detail.

Dev5413
  • 59
  • 1
  • 1
0

You can set the timezone now using powershell and the change will stick even if the VM is restarted, refer this https://www.dcac.com/blog/changing-the-time-zine-of-azure-vms

  • 1
    It's better to provide the code here, qualifying it with version information and an explanation, just in case the site you're linking to goes away or the PowerShell APIs change in a future version – Josh Feb 08 '21 at 20:34