Linux – How to set hwclock to UTC

linuxtimeutc

The times on my arch linux workstation got messed up, so I set the system time with date and then the hardware time with

sudo hwclock --systohc --utc

Now the hwclock gives:

Do 04 Apr 2013 14:12:48 CEST  -0.641471 seconds

but I want it to use UTC, which would be 12:12:48! How do I achieve this?

edit:

some additional weirdness:

$ hwclock --utc
Do 04 Apr 2013 14:20:56 CEST  -0.188214 seconds
$ hwclock --localtime
Do 04 Apr 2013 12:21:01 CEST  -0.438205 seconds
$ date -u
Do 4. Apr 12:21:11 UTC 2013
$ date
Do 4. Apr 14:21:16 CEST 2013

utc and localtime seems to be confused by hwclock…

Best Answer

Yep, in Linux you can use hwclock --systohc, and pay your attention to its manual saying that «…

The time shown is always in local time, even if you keep your Hardware Clock in Coordinated Universal Time. See the --utc option. Showing the Hardware Clock time is the default when no function is specified.

…»

And, BTW, my man hwclock also reveals option --debug which would really help you in your search of the truth.

Related Topic