[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: date & X copy/paste broke on upgrading to Debian 11



On Sun 06 Feb 2022 at 09:12:01 (-0500), Greg Wooledge wrote:
> On Sun, Feb 06, 2022 at 02:00:21PM +0200, Teemu Likonen wrote:
> > * 2022-02-06 11:58:08+0100, José Luis González wrote:
> > 
> > > 1. System time is one hour more than it should. Timezone (as set by
> > > tzdata) is correct.
> > 
> > Nowadays "timedatectl" is used to configure time.
> 
> Strongly disagree.  I mean, it *could* be... but you state it like it's
> an absolute imperative.
> 
> Many of us still use the traditional tools.
> 
> My first question for José is: what does the date command *actually*
> say?  (Follow-ups: What time zone are you in?  How did you configure
> the time zone?  Are you running an NTP daemon?  If so, which one, and
> what does "ntpq -p" report?)
> 
> E.g. for me, I am in the US/Eastern time zone (now called America/New_York)
> and I'm running the "ntp" daemon.  I don't have the TZ variable set.
> So, my setup looks like this:
> 
> unicorn:~$ echo "$TZ"
> 
> unicorn:~$ cat /etc/timezone
> America/New_York
> unicorn:~$ ls -ld /etc/localtime
> lrwxrwxrwx 1 root root 36 Oct 27 07:16 /etc/localtime -> /usr/share/zoneinfo/America/New_York
> unicorn:~$ dpkg -l ntp | tail -1
> ii  ntp            1:4.2.8p15+dfsg-1 amd64        Network Time Protocol daemon and utility programs
> unicorn:~$ ntpq -p
>      remote           refid      st t when poll reach   delay   offset  jitter
> ==============================================================================
>  0.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
>  1.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
>  2.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
>  3.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
> -vps-d455c3c7.vp 91.189.91.157    3 u  759 1024  377   74.942   +1.701   0.819
> +172.106.167.46  209.51.161.238   2 u  543 1024  377   62.995   +1.964   1.041
> -time.nullrouten 132.163.97.1     2 u  485 1024  377   93.519   +0.097   0.823
> *time-sjc.0xt.ca 17.253.4.125     2 u  845 1024  377   96.872   +0.563   2.251
> +li1210-167.memb 66.220.9.122     2 u  566 1024  377   96.236   +0.522  10.941
> -clock.fmt.he.ne .CDMA.           1 u  968 1024  377   93.254   -1.045   7.428
> unicorn:~$ date
> Sun Feb  6 09:05:43 EST 2022
> 
> Note in particular that the timezone is configured in *two* different
> places using two different mechanisms.  Some programs use one, and some
> use the other, so you need to do both.  "Welcome to Unix, kid."  (The
> Debian installer takes care of this for you, if you choose the time zone
> correctly during installation.)
> 
> Andrew's reply about hwclock is also relevant if José is dual-booting
> with another operating system.  Are you doing that, José?

It does seem quite likely that there's a misunderstanding over
timezones, as the OP is posting from +1 and their clock is one
hour in error. They may have to decide whether to run the RTC
in UT (in general the only sensible choice) or Local Time.

(I'm not sure whether DST in relevant at this time of year in
this timezone, unless they observe it in Tristan da Cunha.)

That said, I notice you have ntp installed. Does that mean that
you're keeping your time synchronised with ntp and, if so, what
do you do about systemd-timesyncd, which I understand is enabled
by default since several Debian versions ago.

About setting   hwclock --systohc   directly, I see two problems:
the system's timekeeper might merely set it again itself, losing
whatever you set it to, and also it screws up any calibrations
being made on the RTC's drift.

Cheers,
David.


Reply to: