How to set hwclock to UTC?

Posted on

How to set hwclock to UTC? – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, time, utc, , .

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?


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…

Solution :

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.