[SOLVED] time and date wrong after laptop power drained.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Manjaro xfce:
the time and date displayed on tray icon (bottom right) is :
sunday 06 dec , 15:41
but the actual time and date right now is:
friday 11 dec, 20:47
Code:
$ timedatectl
Local time: So 2020-12-06 16:41:55 CET
Universal time: So 2020-12-06 15:41:55 UTC
RTC time: Do 2020-11-12 20:46:25
Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: no
NTP service: inactive
RTC in local TZ: no
question1:
Can you explain to me there are 3 dates and time : local time, universal time , RTC time.. which one is suppose to be the one display on bottom right ( system time)?
question2:
how to change the time to the right one ?
thx
The RTC time is the Real Time Clock time and that appears to be correct.
Plus I'm not sure if a problem is that the NTP service is inactive. Are you normally connected to the internet? And any idea what's up with the NTPD on your system?
I believe if you enable that and are connected, it'll be resolved. But if you've specifically set to not be that, then I believe you need a startup script line (forget the command and syntax) which sets the clock based on the RTC.
what can i do to activate the NTP ?
do i need to install Chrony ?
I a bit confused here.
can you please tell me how many path can i take ?
1. direct change the time
2. change the time in bios ?
3. install NTP so it auto change time
Am i right about the above 3 paths that i can take ?
The system time converted to your local time zone is typically what is displayed on the desktop.
System time is UTC.
The hardware clock i.e. RTC does not have any reference associated with it accept for the operating system configuration setting which is UTC (RTC in local TZ: no)
Using the Xfce menu navigate to the time and date option and set the time for your local time. That should set the system time correctly and if the hardware clock is also not reset you can do it manually via the hwclock utility or reboot.
Xfce Menu > System Category > left-click the "Time and Date" option.
Manjaro xfce:
the time and date displayed on tray icon
question1:
Can you explain to me there are 3 dates and time : local time, universal time , RTC time.. which one is suppose to be the one display on bottom right ( system time)?
I don't know........ what is displayed depends upon which ever you prefer.
Quote:
question2:
how to change the time to the right one ?
thx
use the date command.
Code:
date -s correct time and date
The correct way to write the string that sets the right time and date will be shown when you type
Code:
date
If you want further detail have a look at the man page for date.
Really ?! i can got to choose which whichever one i want it to display ?
Please show me how.
Thx
They did...man date
I’d also suggest man timedatectl
Read those instead if asking us to paste the content here for you to read it.
If, after you’ve done that, then, if there’s something therein you don’t understand, please don’t hesitate to ask here.
They did...man date
I’d also suggest man timedatectl
Read those instead if asking us to paste the content here for you to read it.
If, after you’ve done that, then, if there’s something therein you don’t understand, please don’t hesitate to ask here.
I am reading on Chrony, chronyc, chronyd...
I don't know if what i am reading is the correct direction or not. But i think since the ntp is disactivated.. i don't know why.. i should consider to make it automated time sync instead of separate from the internet time.
Hence i think at the end i will have to read the date , datetimectl ... huh... using linux is like this, never ending reading.. that's why learning curve is so very high.. that's why not many ppl able to switch it over from windows os.
I always configure my systems to sync to a time server and it can be a bit confusing.
The easiest would be to use systemd-timesyncd to sync the system clock.
Code:
timedatectl set-ntp true
To check status:
timedatectl status
timedatectl timesync-status
That will sync the system clock to an NTP time server pool which by default will be 0.manajro.pool.ntp.org.
huh?
I am now really confused. How many ways to solve this time wrong issue ?
I am reading on make chrony and configure chronyd...
and you said use systemd-timesyncd ..
Pls save me the chase and tell me straight , HOw many ways to go about making the time right ?
I don't mean bad, pls don't get me wrong. If you list out all the option i have to solve my issue, i will be clear on the options i have, that helps me a lot. Thx
Like anything on Linux, there are multiple ways to do anything. Try an internet search for something like "sync time Linux". It's all available, you just have to be able to do an intelligent search.
ntp is the original server/client program to sync time. Its one negative feature is that it is really for servers that run 24/7 and always connected to the internet. ntp is the service daemon and ntpq is the utility to interface with the service.
chrony is the next generation ntp client/server program which is supposed to be more accurate but can compensate for computers not always connected to the internet or on 24/7. chronyd is the service daemon and chronyc is the command line utility to interface with the service.
systemd has its own ntp client i.e systemd-timesyncd. It is only a client. Its pro is it is designed to work with systems without a RTC
timedatectl is the systemd utility to set the time, date and timezone of your computer. It can work with any ntp client and I think Manjaro uses systemd-timesyncd by default. The set-ntp option enables the ntp service.
Regardless you can directly change the system clock using command line utilities.
As posted the date or also using timedatectl:
date -s "12 DEC 2020 14:00:00"
timedatectl set-time '2020-12-14 14:00:00'
I would of also expected a complete shutdown/restart to set the correct time also without doing anything special.
In the progress of reading and learning date and time , chrony and keeps reading..
I read $date tz= ...
i tried $tzselect, i selected another time zone out side of my current residency geo location.. but when i right click "system time" > properties, the timezone in it still same germany.. which i have tzselect other timezone other than Germany..
Using tz in the date command does not change the system timezone. It converts the output of the date command to that tz. If you want to change the time zone of the system use the timdatectl command.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.