Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, I have a small problem: I can't set the right time.
I live in Italy, then, my timezone is Europe/Rome CET UTC+1.
tony:~\& date
Fri 08 Dec 2023 13:06:06 CET
tony:~\& ls -al /etc/localtime
lrwxrwxrwx 1 root root 33 Dec 8 12:51 /etc/localtime -> ../usr/share/zoneinfo/Europe/Rome
tony:~\& su
Password:
root@xxx:/home/tony# sudo ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
Italy time is 12:11 PM, what's wrong ?
Tryed this way, but nothing has changed. sudo dpkg-reconfigure tzdata
Current default time zone: 'Europe/Rome'
Local time is now: Fri Dec 8 14:21:57 CET 2023.
Universal Time is now: Fri Dec 8 13:21:57 UTC 2023.
Seems UTC+1 is NOT listed in Debian timezones? timedatectl list-timezones
Regardless of timezone setting you still need to set the system clock to the correct time.
timedatectl set-time 15:58:30 (Use your current local time)
Post the output of the command timedatectl
When your PC boots the system clock is set using the time from the hardware clock. Since your hardware clock reference is LOCAL the time is converted to UTC before the system clock is set. Hardware clocks do tend to drift and if not correct your system clock will be off. If the only operating system is linux then it is best to set the the hardware clock to UTC. Since the hardware clock itself does not have a timezone setting the reference is configured in the /etc/adjtime file using either LOCAL or UTC.
To keep the time synchronized many use ntp which is an automatic service that runs and sets the system clock using the internet.
You may also need to replace the BIOS battery if your PC is so equipped depending on its age.
Regardless of timezone setting you still need to set the system clock to the correct time.
timedatectl set-time 15:58:30 (Use your current local time)
Post the output of the command timedatectl
When your PC boots the system clock is set using the time from the hardware clock. Since your hardware clock reference is LOCAL the time is converted to UTC before the system clock is set. Hardware clocks do tend to drift and if not correct your system clock will be off. If the only operating system is linux then it is best to set the the hardware clock to UTC. Since the hardware clock itself does not have a timezone setting the reference is configured in the /etc/adjtime file using either LOCAL or UTC.
To keep the time synchronized many use ntp which is an automatic service that runs and sets the system clock using the internet.
You may also need to replace the BIOS battery if your PC is so equipped depending on its age.
Thank you for answering,i did these things:
timedatectl set-time with my local time and went good.
Then i rebooted system and setting up the correct time in BIOS, but when the system was rebooted the current time was wrong
My last try was:
sudo dpkg-reconfigure tzdata putting Porto (UTC+0) as timezone, but, again, nothing has changed!
My pc is about 3/yo i don't thing battery is low.
P.S. the file /etc/adjtime is set to UTC
cat /etc/adjtime
0.000000 1702051655 0.000000
1702051655
UTC
p.s2. i only have Linux installed in my 2 SSD and w11 installed in a Virtualbox.
timedatectl
Local time: Fri 2023-12-08 16:52:32 WET
Universal time: Fri 2023-12-08 16:52:32 UTC
RTC time: Fri 2023-12-08 16:52:32
Time zone: Europe/Lisbon (WET, +0000)
System clock synchronized: yes
NTP service: n/a
RTC in local TZ: no
Everything good, but PC time is: pic 1
editin clock in Lisbon went good: pic2
p.s. The only setting i can change in BIOS is data, but not a timezone.
I am not real familiar with xfce settings but try right clicking on the clock, select properties and there should be a timezone setting.
I did if i use as Timezone Europe/Rome remains +1, if i put Lisbon, then, mark the right time.
Do you suggest another desktop? I don't like Gnome and Cinnamon.
Looks like you are fine, another method is to set TZ. For example:
Code:
setenv TZ Europe/Rome
or if sh type
export TZ="Europe/Rome"
The values to use are probably under dir "/usr/share/zoneinfo"
this way you do not have to change the clock.
But the sad thing with these new Desktop Environments, setting TZ seemed to have morphed to the way Microsoft Window does things. You need to use a GUI application. In the past, you could set TZ to whatever timezone you happen to be in, not having to worry about the system clock is. You can just change it on the fly easilly and each user can have their own TZ.
The desktop timezone setting is separate from the system timezone setting or an individual TZ variable setting. Many desktops have the option of adding "world" clocks. The system clock is still set by the usual methods. I am not sure it is a sad thing.
Looks like you are fine, another method is to set TZ. For example:
Code:
setenv TZ Europe/Rome
or if sh type
export TZ="Europe/Rome"
The values to use are probably under dir "/usr/share/zoneinfo"
this way you do not have to change the clock.
But the sad thing with these new Desktop Environments, setting TZ seemed to have morphed to the way Microsoft Window does things. You need to use a GUI application. In the past, you could set TZ to whatever timezone you happen to be in, not having to worry about the system clock is. You can just change it on the fly easilly and each user can have their own TZ.
Hello, thanks for posting, these the results:
root@xxx:/home/tony# sudo setenv TZ Europe/Rome
sudo: setenv: command not found
root@xxx:/home/tony# export TZ="Europe/Rome"
root@xxxx:/home/tony# timedatectl | grep local
RTC in local TZ: no
root@Nxxx:/home/tony# timedatectl
Local time: Sat 2023-12-09 09:29:56 WET
Universal time: Sat 2023-12-09 09:29:56 UTC
RTC time: Sat 2023-12-09 09:29:56
Time zone: Europe/Lisbon (WET, +0000)
System clock synchronized: yes
NTP service: n/a
RTC in local TZ: no
I already tryed:
sudo dpkg-reconfigure tzdata ;(
The desktop timezone setting is separate from the system timezone setting or an individual TZ variable setting. Many desktops have the option of adding "world" clocks. The system clock is still set by the usual methods. I am not sure it is a sad thing.
Yes you are correct, and that is my point by saying this:
Quote:
... setting TZ seemed to have morphed to the way Microsoft Window does things
In the old days™, setting TZ was an easy thing, you never had to worry what the hardware clock was set as. Just add TZ to ~/.xsessions and/or ~/.xinitrc maybe ~/.profile and you are good.
Now with the way Linux works, you need to run a M/S Windows type time adjustment
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.