different times for last boot between last and uptime -s
Tom Mitchell
niftyubuntu at niftyegg.com
Wed Dec 7 02:08:25 UTC 2022
On Mon, Dec 5, 2022 at 1:36 AM Lentes, Bernd
<bernd.lentes at helmholtz-muenchen.de> wrote:
>
> Hi guys,
>
> i just realized a strange behaviour. I had to find out the last boot procedure
> for an Ubuntu 20.04.3 LTS.
> uptime -s says:
> root at crispor-server:/var/log/atop# uptime -s
> 2022-12-02 21:37:18
>
> last says:
> reboot system boot 5.4.0-91-generic Fri Dec 2 22:37 still running
>
> The current date and time is correct, timezone is Berlin/Europe.
>
> This difference makes debugging more complicated.
> Does anyone know the reason ?
Recall that windows keeps local time on the RTC.
Unix and Linux keep the UTC as the anchor time.
and all dates are times are computed from UTC.
WindowsPC dual boot was a pain with clocks until date time
could cope with local time on the RTC.
Thus there are corrections to cause things to
Double check:
NAME
hwclock - time clocks utility
...
-l, --localtime; -u, --utc
Indicate which timescale the Hardware Clock is set to.
The Hardware Clock may be configured to use either the UTC
or the local timescale, but nothing in the clock itself says which
alternative is being used.
The --localtime or --utc options give this information to
the hwclock command. If you specify the wrong one (or specify neither
and take a wrong default),
both setting and reading the Hardware Clock will be incorrect.
If you specify neither --utc nor --localtime then the one
last given with a set function (--set, --systohc, or --adjust), as
recorded in /etc/adjtime, will
be used. If the adjtime file doesn’t exist, the default is UTC.
Note: daylight saving time changes may be inconsistent when
the Hardware Clock is kept in local time. See the discussion below,
under LOCAL vs UTC.
More information about the ubuntu-users
mailing list