If you falter in times of trouble, how small is your strength!
Sounds like proverb 😀 but this is actually true if you’re working with ubuntu or other linux that use UTC by default, especially if you’re dual boot with winblows and not setting the timezone properly within each OS. Operating systems store and retrieve the time in the hardware clock located on your motherboard BIOS, so that it can keep track of the time even when the system does not have power. Most operating systems (Linux/Unix/Mac) store the time on the hardware clock as UTC by default, though some systems (notably winblows) store the time on the hardware clock as the ‘local’ time. This causes problems in a dual boot system if both systems view the hardware clock differently.
The reason why unix/linux using utc by default is that you don’t need to change the hardware clock when moving between timezones or when Daylight Savings Time (DST) begins or ends as UTC does not have DST or timezone offsets.
Changing Linux to use local time is easier and more reliable than changing winblows to use UTC, so dual-boot Linux/Winblows systems tend to use local time.
Make winblows to use UTC
Read this somewhere on ubuntu wiki, and write down here as my note :
To make MS Windows calculate the time from the hardware clock as UTC. Create a file named WindowsTimeFixUTC.reg with the following contents and then double click on it to merge the contents with the registry:
{code}Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTimeZoneInformation] “RealTimeIsUniversal”=dword:00000001{/code}
Note: This method was not initially supported on Windows Vista and Server 2008, but came back with Vista SP2, Windows 7 and Server 2008 R2.
Make Linux to use Localtime
To tell your ubuntu system that the hardware clock is set to localtime:
- edit /etc/default/rcS using your favorite editor, and change UTC=yes to UTC=no
- execute {code}hwclock –systohc –localtime{/code} (this will sync hwclock and date) – you may check the results of hwclock and date command, it should be the same.
At least you have to set clock on winblows os once more time after this, and it should be okay.