Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #268075 > unrolled thread

Re: strange time problem with bullseye

Started byGreg Wooledge <greg@wooledge.org>
First post2024-03-05 21:00 +0100
Last post2024-03-06 04:10 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.debian.user

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: strange time problem with bullseye Greg Wooledge <greg@wooledge.org> - 2024-03-05 21:00 +0100
    Re: strange time problem with bullseye Greg Wooledge <greg@wooledge.org> - 2024-03-05 22:50 +0100
    Re: strange time problem with bullseye Jeffrey Walton <noloader@gmail.com> - 2024-03-06 04:10 +0100

#268075 — Re: strange time problem with bullseye

FromGreg Wooledge <greg@wooledge.org>
Date2024-03-05 21:00 +0100
SubjectRe: strange time problem with bullseye
Message-ID<IeJ7b-eEa0-7@gated-at.bofh.it>
On Wed, Mar 06, 2024 at 02:47:06AM +0800, hlyg wrote:
> my newly-installed deb11 for amd64 shows wrong time,  it lags behind correct
> time by 8 hours though difference between universal and local is ok.

Run the commands "date" and "date -u" and show us the output.

Then tell us what you think the output should have been.

> but my deb11 for i386 on same machine shows correct time. i installed it
> long time ago

You have more than one operating system on this machine, then.  Are these
two Debian instances the *only* systems, or are there others?  Is Windows
one of them?

When multi-booting, it's important that all of the operating systems on
the machine agree on whether the real time clock is set to UTC, or to
local time.  For a long time, the conventional approach was to use local
time if you had to multi-boot with Windows (because Windows insisted on
it), or UTC if you only boot Linux-based systems.  I don't know how
Windows deals with the real time clock in modern times.

For comparison, please run "date" and "date -u" on the "deb11 for i386"
instance.

In particular, you're looking to see whether the "date -u" command
reports correct UTC time, and you're looking for what time zone the "date"
command uses.

If your UTC time is right but your time zone is wrong, then you need to
change your time zone.  On Debian, you do this by running
"dpkg-reconfigure tzdata".

If your UTC time is wrong, but it's off by exactly the amount that your
local time differs from UTC, then it's possible that one or more of your
multi-boot operating systems disagree on whether the real time clock is
set to UTC or local time.  Pick one, and then configure all of your
operating systems to use that.

If your UTC time is just wrong, with no obvious reason for it, then the
next question is whether you're running NTP.  And if not, why not (e.g.
this machine is on an isolated network or something).  Most computers
should be using NTP (Debian offers several choices for this), which will
keep the system clock reasonably correct, unless the hardware is failing.

[toc] | [next] | [standalone]


#268078

FromGreg Wooledge <greg@wooledge.org>
Date2024-03-05 22:50 +0100
Message-ID<IeKPD-eFeG-1@gated-at.bofh.it>
In reply to#268075
On Tue, Mar 05, 2024 at 08:28:49PM +0800, hlyg wrote:
> Thank Greg Wooledge!
> 
> zhou@debian:~$ date
> Wed 06 Mar 2024 04:07:02 AM CST
> zhou@debian:~$ date -u
> Tue 05 Mar 2024 08:07:07 PM UTC
> 
> above is from deb11 for i386, it's correct

OK, and your time zone is 20 hours ahead of UTC, it appears.

> zhou@debian:~$ date
> Tue 05 Mar 2024 08:13:23 PM CST
> zhou@debian:~$ date -u
> Tue 05 Mar 2024 12:13:27 PM UTC
> 
> above is from deb11 for amd64, it's wrong, utc lag behind by 4 hours

Now this is odd-looking.  In this instance, your time zone is 4 hours
*behind* UTC instead of 20 hours ahead.  Which makes it off by exactly
one whole day.

Also, it *looks* like your i386 instance wrote UTC to the system clock,
and then your amd64 instance read that as local time.  You can see that
the 8:07:07 PM from the first instance is quite close to the 8:13:23 PM
from the second.

> Windows shall not cause problem, i rarely use Windows

The question isn't how often you use it, but whether you booted it in
between the two instances above.  Probably not, I suppose.

> i don't know if ntp is running, what's default configuration by deb11 amd64
> installer?

There is no "default".  Or rather, there are lots of defaults.  It's not
useful to ask about defaults.  Ask about what you have.

These are the packages that provide time-daemon on Debian 11:

systemd-timesyncd
openntpd
ntp
chrony

If one of those is installed and running, it should set your clock from
Internet sources (assuming it's configured reasonably, and you have
Internet access).

But more importantly, you need to check whether your Debian instances are
using local time or UTC for the real time clock, because it *looks* like
the i386 one is using UTC and the amd64 is not.

Check your /etc/adjtime files.

I'm also extremely curious why two different systems report "CST" with
two wildly different offsets from UTC.  What does
"ls -ld /etc/localtime" give on your systems?  Are they both the same?

[toc] | [prev] | [next] | [standalone]


#268080

FromJeffrey Walton <noloader@gmail.com>
Date2024-03-06 04:10 +0100
Message-ID<IePPj-eIma-3@gated-at.bofh.it>
In reply to#268075
On Tue, Mar 5, 2024 at 7:07 PM hlyg <hlyg2023@outlook.com> wrote:
>
>  [...]
>
> Windows shall not cause problem, i rarely use Windows
>
> i don't know if ntp is running, what's default configuration by deb11
> amd64 installer?

If you are dual booting Linux and Windows, then see
<https://wiki.debian.org/DateTime#Windows_Dual_Boot_Strategy>.

Jeff

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web