如何更改 Azure 虚拟机中的时区?

How to change time zone in Azure Virtual Machine?

如何在 Azure 虚拟机 运行 windows 服务器中将时区从 UTC 更改为阿拉伯标准时间?

恐怕您实际上无法更改时区。即使您更改了一次,重新启动后时区也会恢复为 UTC。

此外,不建议更改 Azure IaaS VM 的时区。

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.

您还可以查看 this blog 了解有关 Azure 时区的更多详细信息。

希望对您有所帮助!

Azure 只是提供在 VM 配置期间设置区域(时区)选择! 可以参考这个 https://docs.microsoft.com/en-us/previous-versions/azure/dn495299(v=azure.100)

此外,如果您想在 VM 配置后更改时间,则可以使用 Set-TimeZone -Id "Time Zone Id" 要获取您的时区,请使用 Get-TimeZone -ListAvailable powershell 命令。

尽管如此,时间永远不会回到 UTC 时区。但如果是这样,那么您必须使用 Azure Desired State Configuration。这有助于使更改持久化。详情请参考Azure Desired State Configuration

您现在可以使用 powershell 设置时区,即使重新启动 VM,更改也会保留,请参阅此 https://www.dcac.com/blog/changing-the-time-zine-of-azure-vms