[Solved] Problem with hour Ubuntu and Windows 10 Enterprise LTSB

Discussion in 'Windows 10' started by antonio8909, Aug 16, 2016.

  1. antonio8909

    antonio8909 MDL Guru

    Feb 16, 2014
    3,111
    1,516
    120
    I have Ubuntu 16.04 and Windows 10 Enterprise LTSB with dual boot. I have problem with the hour that Ubuntu and Windows provides me. If I change the hour in Windows for put the real one (20:37 for example) in Ubuntu says that it's 20:37. If I change it in Ubuntu, in Windows will say that it's 22:37.

    How can I fix it?

    Thanks!
     
  2. hoanglan87

    hoanglan87 MDL Novice

    Jul 16, 2011
    4
    1
    0
    #2 hoanglan87, Aug 16, 2016
    Last edited by a moderator: Apr 20, 2017
    Turn off set time automatically for windows 10 and apply UTC reg fix:

    Using regedit, add a DWORD value with hexadecimal value 1 to the registry:
    Code:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal
    
    You can do this from an Administrator Command Prompt running:
    Code:
    reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_DWORD /f
    
    Alternatively, create a *.reg file (on the desktop) with the following content and double-click it to import it into registry:
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
         "RealTimeIsUniversal"=dword:00000001
    
    Then you can set the correct time in Ubuntu.

    Also you should turn off fast shutdown in windows 10 to avoid missing data with dualboot
     
  3. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,588
    340
    #3 Tito, Aug 16, 2016
    Last edited: Mar 27, 2018
    Another approach: You can set the hardware clock time standard in the Linux distribution. You can check what you have set to use by:
    Code:
    $ timedatectl | grep local
    The hardware clock can be queried and set with the timedatectl command. To change the hardware clock time standard to localtime, use:
    Code:
    $ timedatectl set-local-rtc 1
    If you want to revert to the hardware clock being in UTC, do:
    Code:
    $ timedatectl set-local-rtc 0
     
  4. hb860

    hb860 MDL Expert

    May 7, 2010
    1,012
    1,858
    60
    I suggest to use the answer provided by Tito rather than the Registry tweak.
    I had issues with that tweak in the past.Unfortunately, I don't remember which exactly.
    Also, if you will re-install Windows, you need no tweak it again.
    It will just work.
    In my dualboot system, it also configured Linux that the hardware clock is in local time.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    895
    482
    30
    Damn. I would be interessted in your issues. - Maybe external NTP or DST related?
     
  6. endbase

    endbase MDL Guru

    Aug 12, 2012
    4,673
    1,709
    150

    It is a pretty known issue with linux in my experience just do as Tito provited :tea:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    895
    482
    30
    My question is completley unrelated to linux . He said he had issues. Just interessted in maybe which direction.
     
  8. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120

    Read the arch linux link ^^ there's a section dedicated to windows, and further links explaining the the feature was buggy and unsupported on older windows flavours.
     
  9. endbase

    endbase MDL Guru

    Aug 12, 2012
    4,673
    1,709
    150

    My bad then :D but still remains an linux thingy ;)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. hb860

    hb860 MDL Expert

    May 7, 2010
    1,012
    1,858
    60
    For issues.
    I was running Windows 7 that time, maybe I am wrong, but I think I was getting incorrect time in Windows even after the tweak. It was changed from time to time.
    So settings Linux considering hardware clock as local time clock is reliable solution.
    I live with without a single issue.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. T-S

    T-S MDL Guru

    Dec 14, 2012
    3,984
    1,331
    120
    #12 T-S, Aug 16, 2016
    Last edited: Aug 16, 2016

    To be precise unix use the UTC since the stone age, DOS and Windows, as usual, introduced a non standard behavior.

    So technically is a Windows thingy. Windows has the bad behavior that should be fixed. Practically solve the problem from the linux side is easier and well proven, while doing it on windows is not.
     
  12. Nimbus2000

    Nimbus2000 MDL Senior Member

    May 5, 2010
    257
    179
    10
    #13 Nimbus2000, Aug 16, 2016
    Last edited: Aug 16, 2016
    My solution for this issue is to make Linux use 'Local' time.

    To tell your Ubuntu system that the hardware clock is set to 'local' time:

    sudo gedit /etc/default/rcS

    add or change the following section

    #Set UTC=yes if your hardware clock is set to UTC (GMT)
    UTC=no
     
  13. antonio8909

    antonio8909 MDL Guru

    Feb 16, 2014
    3,111
    1,516
    120
    #15 antonio8909, Aug 17, 2016
    Last edited by a moderator: Apr 20, 2017
    (OP)
    This works!!!!!!

    Thank you very much Tito
     
  14. verndog

    verndog MDL Member

    May 3, 2010
    211
    93
    10
    #16 verndog, Aug 18, 2016
    Last edited by a moderator: Apr 20, 2017
    This fixed no longer works with Ubuntu 16.10 "Yakkety". Tried the 'rcS' set to UTC=no. Still fails.
    You need to use the Windows registry fix and leave Ubuntu on UTC. I have a bug reported, but no response.
    I find it works best leaving timedatectl alone, and using Windows fix.
     
  15. antonio8909

    antonio8909 MDL Guru

    Feb 16, 2014
    3,111
    1,516
    120
    Ubuntu 16.10 is a beta version. Wait until the final one ;)
     
  16. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,449
    90
    #18 pf100, Aug 18, 2016
    Last edited by a moderator: Apr 20, 2017
    Ubuntu 16.04 works when dual-booting with
    Code:
    timedatectl set-local-rtc 1
    And LTS is the one that matters, to me.
     
  17. antonio8909

    antonio8909 MDL Guru

    Feb 16, 2014
    3,111
    1,516
    120
    @Tito I tried to use the commands again in Ubuntu 17.04 and it doesn't work.

    Is there any new fix?

    Thanks
     
  18. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,588
    340
    @antonio8909

    I've setup couple of VMs as well real PCs with Ubuntu 17.04 along Windows - no issue with the above one.