Home > Linux / Unix, Tutorial > Fix date and time in Ubuntu

Fix date and time in Ubuntu

Dual-booting with Ubuntu and Windows sometimes giving a problem with date and time in Ubuntu. This is a well-established problem when dual-booting, since Linux assumes the hardware clock represents UTC, whereas Windows assumes the hardware clock represents local time. Luckily Linux provides ways to change this to fix it.

If you go into your clock settings, I think you can select between setting the hardware as either UTC or local time. Try switching that, and then adjust the time and see if it “sticks.”

If not, you can do this via the commandline in Linux :-

  1. In Linux, set the date and time to what it currently is. For example if it’s 10:20am local time:
    user@server:~$ sudo date -s 10:20
  2. Then update the hardware clock accordingly, and force this to be considered “localtime”:
    user@server:~$ sudo /sbin/hwclock --systohc --localtime
  3. Check to make sure it looks right:
    user@server:~$ sudo /sbin/hwclock --localtime
  4. Sync between hardware clock and system clock:
    user@server:~$ sudo /sbin/hwclock --hctosys --localtime

Now Linux should consider the clock to be “localtime”, which should be identical to what Windows is doing. So after rebooting into Windows, the time should look right.

Hope that helps.

  1. June 21, 2008 at 6:38 pm

    Got similar problem, thanks, I will try it later. Save your post for now since I’m at my office currently. Thanks again.

  2. June 23, 2008 at 9:36 am

    I hope it will fix your problem…

  3. oldcity
    June 24, 2008 at 6:47 am

    1. Changed BIOS to boot Ubuntu 8.04
    2. Fresh boot showed correct time.
    3. Followed your instructions.
    3a. sudo /sbin/hwclock –show displayed correct time
    4. Did restart and accessed BIOS the clock was plus 4 hours.
    5. Reset time with reboot.
    6. Reboot showed correct time.
    7.Using sudo /sbin/hwclock –show displayed time minus 4 hours.
    Tried many variations with no success.
    hth
    oldcity

  4. oldcity
    June 24, 2008 at 6:49 am

    Re above booted from using Vista.

  5. June 24, 2008 at 1:54 pm

    oldcity: have you try update your time with ntp server.

  6. oldcity
    June 24, 2008 at 8:47 pm

    will advise in on Monday.

  7. pippo
    December 15, 2008 at 5:28 pm

    This worked for me – thanks.

  8. ershovis
    June 17, 2009 at 2:54 pm

    Greate!

  9. June 22, 2009 at 8:14 am

    Thx!

    Didnt notice the importance of this stuff until MySQL and PHP surprised me with displaying different time

    SELECT CURRENT_TIMESTAMP
    // 2009-06-22 8:00:00

  10. July 6, 2009 at 11:57 pm

    eeepp…,

  11. July 7, 2009 at 12:07 am

    showing some love,

  12. July 7, 2009 at 12:07 am

    hey thanks for the add I love all your stuff,

  13. July 7, 2009 at 12:07 am

    hey thanks for the add I love all your stuff,

  14. July 7, 2009 at 12:07 am

    i love your work!,

  15. November 27, 2009 at 7:09 pm

    tzselect is not good
    use
    dpkg-reconfigure tzdata

  16. December 8, 2009 at 2:22 am

    the best fix I’ve found so far is to set in

    /etc/default/rcS

    the line UTC=yes to
    UTC=no and reboot into Windows. Make sure the clock is right there, then boot back into Ubuntu.

  17. September 24, 2010 at 3:22 am

    to fix this issue

    go into control center and look for time and date, that is the problem, add your time zone ! and reboot it will be fixed. the clock on the task-bar is useless because the core zones have not be modified in the control center

  18. May 8, 2011 at 7:45 am
  19. September 4, 2011 at 7:11 am

    I work with computers baby loony toons 939

  20. September 6, 2011 at 7:16 pm

    Where do you live? ordinary teen porn sml

  21. September 8, 2011 at 5:40 am

    Could I borrow your phone, please? pedo
    =-D

  22. September 25, 2011 at 1:32 am

    A law firm Imgboards Models
    iswor

  23. September 25, 2011 at 3:07 am

    When do you want me to start? Perteen Model Pics
    :-OOO

  24. September 25, 2011 at 10:25 am

    I’ll call back later Sarka Model Teen
    pnqam

  25. September 25, 2011 at 6:20 pm

    Are you a student? Supermodels Big Tits
    934673

  26. October 31, 2011 at 4:09 am

    Thanks a lot!

  27. May 2, 2012 at 3:41 pm

    Where are you from? http://ypoobecilua.blog.free.fr/ commanders models yo i need a bitch like dat she freaky as hell…at first i thougt he might be rapin her but damn its da otha way around(she fuckin da shit out of him)

  28. May 6, 2012 at 1:41 pm

    We’d like to invite you for an interview http://lycoleukae.de.tl preteen boy nipple she’s ugly. that’s who she is. disgusting cunt. goddamn she’s fucking gross. the brunette is ok i guess.

  29. Eric
    August 28, 2012 at 12:23 am

    Thank you this really does help.

  30. October 20, 2012 at 12:34 am

    Thanks for this. I just started working with Ubuntu and this will help me with the issue I’m having with the time.

    Cheers.

  1. No trackbacks yet.

Leave a reply to Ofrisfsi Cancel reply