【发布时间】:2020-05-04 05:38:40
【问题描述】:
我正在尝试将实例上的日期和时间设置更改为 UTC+10 Canberra,Sydney,Melbourne,但它总是不断回滚到 UTC+00 Monrovio, Reykjavik。即使我选择设置时区为自动也没关系。enter image description here
【问题讨论】:
标签: date google-cloud-platform timezone
我正在尝试将实例上的日期和时间设置更改为 UTC+10 Canberra,Sydney,Melbourne,但它总是不断回滚到 UTC+00 Monrovio, Reykjavik。即使我选择设置时区为自动也没关系。enter image description here
【问题讨论】:
标签: date google-cloud-platform timezone
提供的屏幕截图中的“australia-southeast1-b”区域是 Google Cloud Platform 资源的部署区域,运行您的虚拟机实例的物理主机位于该区域。这是一个地理区域。它与时间无关。
要在 Windows 中配置日期和时间,您应该:
Google Cloud Engine VM 实例只是一个虚拟机,它在启动时将硬件时钟设置为 UTC,就像当今许多现代服务器所做的那样。
如果您在 GCP 控制台中查看虚拟机实例日志,您会看到虚拟机 BIOS 以 UTC 报告时间
2019/10/3 14:9:44 Begin firmware boot time
一段时间后 BIOS 移交给引导加载程序
2019/10/3 14:9:45 End firmware boot time
Booting from Hard Disk 0...
操作系统启动。操作系统时间服务在后台识别系统时区,然后设置时间并将时间与时间源同步。从那时起,运行程序和服务会根据本地系统时间报告事件:
...
2019/10/03 09:10:05 GCEWindowsAgent: GCE Agent Started (version 4.6.0@1)
在 Windows 事件日志中,您应该会看到时间服务所做的条目:
Log Name: System
Source: Time-Service
Level: Information
The time provider NtpClient is currently receiving valid time data from metadata.google.internal,0x1 (ntp.m|0x1|0.0.0.0:123->169.254.169.254:123).
The time service is now synchronizing the system time with the time source metadata.google.internal,0x1 (ntp.m|0x1|0.0.0.0:123->169.254.169.254:123).
在命令提示符下可以确保时间配置和状态正确:
C:\Users\user>systeminfo | find /i "Time"
System Boot Time: 10/3/2019, 9:09:49 AM
Time Zone: (UTC-06:00) Central Time (US & Canada)
因此您不需要手动或使用任何启动脚本同步时间。时间服务将为您执行此操作:在系统启动后不久同步系统时间并在之后保持同步。
您只需为 Windows 设置正确的Time zone 和Internet time server,然后确保时间服务器可通过网络访问。
如果等不及时间同步周期完成,可以登录Windows手动强制时间同步:
net stop W32Time
net start W32Time
w32tm /resync /force
【讨论】:
到 O.P 如果我理解正确,请回答您的问题,您的答案是:
timedatectl set-timezone "Australia/Melbourne"
【讨论】: