sab, 16 lug 2022, 16:53:21, Piergiorgio Sartor ha scritto:
> Ovviamente sono identici, uno e` il
> link all'altro...
> Sarebbe stato interessante vedere cosa
> succede se "/etc/timezone" ha qualcosa
> di diverso.
> Influenza "date" oppure e` solo un
> riferimento per il sistema?
Ho fatto una prova ed ho modificato Roma con New York:
$ sudo dpkg-reconfigure tzdata
Current default time zone: 'Europe/Rome'
Local time is now: Sat Jul 16 18:32:55 CEST 2022.
Universal Time is now: Sat Jul 16 16:32:55 UTC 2022.
$ sudo dpkg-reconfigure tzdata
Current default time zone: 'America/New_York'
Local time is now: Sat Jul 16 12:33:43 EDT 2022.
Universal Time is now: Sat Jul 16 16:33:43 UTC 2022.
$ timedatectl
Local time: sab 2022-07-16 12:34:24 EDT
Universal time: sab 2022-07-16 16:34:24 UTC
RTC time: sab 2022-07-16 16:34:24
Time zone: America/New_York (EDT, -0400)
System clock synchronized: yes
NTP service: activ
$ cat /etc/timezone
America/New_York
$ ls -l /etc/localtime
lrwxrwxrwx 1 root root 36 16 lug 12.33 \
/etc/localtime -> /usr/share/zoneinfo/America/New_York
Quindi il comando tzdata modifica sia timezone che localtime .
$ date
sab 16 lug 2022, 12:36:04, EDT
Ora modifico a mano il file /etc/timezone mettendo nuovamente
Europe/Rome e riavvio.
$ cat /etc/timezone
Europe/Rome
$ timedatectl
Local time: sab 2022-07-16 12:42:59 EDT
Universal time: sab 2022-07-16 16:42:59 UTC
TC time: sab 2022-07-16 16:42:59
Time zone: America/New_York (EDT, -0400)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
$ date
sab 16 lug 2022, 12:43:45, EDT
Direi che modificare a mano /etc/timezone non influenza "date".
> Da me non esiste "/etc/timezone", ma solo
> "/etc/localtime" che e` un link come nel
> tuo caso.
>
> Cosa dice la man page di "date", al riguardo
> la time zone?
>
> Anche in Ubuntu fa riferimento a "/etc/localtime"?
Vedi tu, questo è il man date di Ubuntu 22.04
https://termbin.com/2r7r