Skip to content

Cloud

Correct time in Windows and Linux

Use UTC for the hardware clock in your WVG VM, choose a time zone and verify Windows or Linux time synchronization.

In this guide

Clock, time zone and synchronization

A WVG VM presents its virtual hardware clock (RTC) in UTC. The operating system should interpret it as UTC; local time is configured separately through the time zone. Run the following steps inside your own VM.

  • The RTC setting determines how the operating system interprets the virtual hardware clock, particularly at startup.
  • The time zone controls local display, including daylight saving time where applicable. UTC is also a valid time zone for a server.
  • Time synchronization continuously corrects the system clock. Changing the time zone does not replace it.

Windows: interpret the RTC as UTC

  1. 1

    Check the current value

    Open Command Prompt (CMD) as administrator. If the query returns REG_DWORD and 0x1, the setting is already correct. A value-not-found message means this registry value has not been created.

    Check RealTimeIsUniversal
    reg query HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal
  2. 2

    Set the value to 1 if needed

    If the value is missing or different, use the command below. The type is REG_DWORD even on 64-bit Windows; do not use REG_QWORD.

    Use UTC for the RTC
    reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1

    The command has no /f switch. If the value already exists, it may ask to overwrite it; confirm only if you intend to change it to 1.

    Verify the saved type and value
    reg query HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal

    Expected value: RealTimeIsUniversal, REG_DWORD, 0x1.

  3. 3

    Restart the VM

    After making the change, restart Windows normally. Then check the value and displayed time again. The registry change does not restart the VM for you.

Windows: local time and W32Time

  1. 1

    Choose only the time zone you want

    Use tzutil /g to see the current zone. Central Europe Standard Time is suitable for local time in Czechia. Skip that example if the server should display UTC or another zone.

    Show the current time zone
    tzutil /g
    Optional: local time for Czechia
    tzutil /s "Central Europe Standard Time"

    This changes only the time zone. It does not replace the RealTimeIsUniversal setting.

  2. 2

    Check the source and latest synchronization

    Check the Windows Time status and configured source. For a domain-joined VM, preserve its domain time hierarchy and Group Policy settings.

    Synchronization status
    w32tm /query /status
    Current time source
    w32tm /query /source
    Effective configuration and its origin
    w32tm /query /configuration
  3. 3

    Request synchronization if needed

    If the service is running and has the correct source, you can request another synchronization. If it fails, check the service, source availability and domain policies first; do not replace them with an arbitrary public NTP server.

    Synchronize using the configured source
    w32tm /resync

Linux: check the RTC mode first

If the output says RTC in local TZ: no, the RTC mode is already correct and does not need changing. If it says yes, first confirm that the system time is actually correct, for example after successful synchronization by the existing time service.

Show system time, time zone and RTC settings
timedatectl status
  1. 1

    Switch to UTC only if the RTC uses local time

    With the system clock confirmed correct, run the following command and check the status again.

    Switch the RTC to UTC
    sudo timedatectl set-local-rtc 0
    Check the RTC mode again
    timedatectl status

    Expected: RTC in local TZ: no.

Linux: time zone and the existing time service

  1. 1

    Change the time zone only when needed

    Choose Europe/Prague only if you want local time for Czechia. Keeping the server in UTC is valid.

    Optional: local time for Czechia
    sudo timedatectl set-timezone Europe/Prague
  2. 2

    Keep the current synchronization service

    If chronyd or ntpd is already running, do not add a competing time daemon. With chrony, use these commands to check the clock and its sources; for ntpd, use your distribution diagnostic tools.

    Chrony: clock status
    chronyc tracking
    Chrony: time sources
    chronyc sources -v

    Only for systems using chrony. The * state marks the selected source; also check the tracking output.

  3. 3

    Enable through systemd only when applicable

    Only if no other solution is running and the distribution provides a time service supported by systemd, you can enable synchronization with this command. It activates an available integrated service; it is not an instruction to install another daemon.

    Conditional: enable available time synchronization
    sudo timedatectl set-ntp true

    Skip this step if chronyd or ntpd is already in use.

Verify the result after a restart too

  • Windows: RealTimeIsUniversal is REG_DWORD with value 0x1, and W32Time reports the expected source and successful synchronization.
  • Linux: RTC in local TZ is no. Also check synchronization using the tool for the active time service; an enabled service alone does not prove successful synchronization.
  • The displayed local time matches the selected time zone. A difference between local time and UTC is expected unless the selected zone is UTC.
  • After a normal VM restart, check the time again. If it is still wrong, send support your OS version and the diagnostic outputs above; do not include passwords or access credentials.
Back to the knowledge base