Code: Select all
root@debian-luiz-computer:/home/luiz# hwclock
Wed 10 May 2017 12:43:22 PM PDT -0.297209 seconds
root@debian-luiz-computer:/home/luiz# su luiz
luiz@debian-luiz-computer:~$ date
Wed May 10 12:43:46 PDT 2017
Code: Select all
root@debian-luiz-computer:/home/luiz# hwclock
Wed 10 May 2017 12:43:22 PM PDT -0.297209 seconds
root@debian-luiz-computer:/home/luiz# su luiz
luiz@debian-luiz-computer:~$ date
Wed May 10 12:43:46 PDT 2017
Code: Select all
NAME
hwclock - query or set the hardware clock (RTC)
SYNOPSIS
hwclock [function] [option...]
DESCRIPTION
hwclock is a tool for accessing the Hardware Clock. You can display the current time, set the Hardware
Clock to a specified time, set the Hardware Clock from the System Time, or set the System Time from the
Hardware Clock.
You can also run hwclock periodically to add or subtract time from the Hardware Clock to compensate for
systematic drift (where the clock consistently loses or gains time at a certain rate when left to run).
FUNCTIONS
You need exactly one of the following options to tell hwclock what function to perform:
-r, --show
Read the Hardware Clock and print the time on standard output. 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.
from : http://www.thegeekstuff.com/2013/08/hwc ... ce=tuicool
This is the same date and time that you’ll see from the BIOS screen.
It does also go on to say:1. Display Hardware Clock Date and Time
Just type hwclock, which will display the date and time of your system’s hardware clock. This is the same date and time that you’ll see from the BIOS screen. You can also use option -r, or –show to display the date and time.
So yes, they might be the same, in fact they should be.Note: The output of the date command might be same as the output of the hwclock command (actually it should be the same). But, the date command gets the date and time from the clock managed from Linux kernel. This in example, there is around 10 mins difference between them.
Postby luiznetto » 2017-05-10 13:13
This is a little bit confusing, isn't it?
This is correct, read the :Re: Setting time, wi-fi
Postby Dai_trying » 2017-05-10 12:57
If you have your hardware clock set to UTC you can just date -u
Code: Select all
man date
$ man date
DATE(1) General Commands Manual
-----snip--------------------
-u Display or set the date in UTC (Coordinated Universal) time.
This is why the hardware should be set to UTC, you don't seem to be sure of this, and then proceed to throw in all kinds of "What if " things,...that is what is making it confusing, Why are you doing that ?Postby luiznetto » 2017-05-10 13:13
This is a little bit confusing, isn't it? I know that my hardware clock shows something different from the time where I am now (San Francisco), and it probably shows utc, but what if there was a difference between what my hardware clock shows and utc? What if my hardware clock was set by someone to the time in Paris or Moscow? The man pages for both date and hwclock are not very clear. I wish they stated clearly, this command shows what is in your BIOS clock. Period. Nothing more than that.
Well simply set it to UTC. Stop making something confusing, when it really is simple.What if my hardware clock was set by someone to the time in Paris or Moscow?