LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 12-11-2020, 01:50 PM   #1
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Rep: Reputation: Disabled
time and date wrong after laptop power drained.


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
 
Old 12-11-2020, 01:55 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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.
 
Old 12-11-2020, 02:29 PM   #3
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Exclamation

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 ?
 
Old 12-11-2020, 02:59 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
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.
 
Old 12-11-2020, 03:35 PM   #5
quickbreakfast
Member
 
Registered: Oct 2015
Location: northern territory
Distribution: slackware 15
Posts: 335

Rep: Reputation: Disabled
Quote:
Originally Posted by andrewysk View Post
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.
 
Old 12-11-2020, 04:03 PM   #6
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by quickbreakfast View Post
I don't know........ what is displayed depends upon which ever you prefer.
Really ?! i can got to choose which whichever one i want it to display ?
Please show me how.
Thx
 
Old 12-11-2020, 04:30 PM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by andrewysk View Post
Code:
NTP service: inactive
https://wiki.manjaro.org/index.php?search=ntp
https://wiki.archlinux.org/index.php..._Time_Protocol
 
Old 12-11-2020, 04:40 PM   #8
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,726

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by andrewysk View Post
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.
 
Old 12-12-2020, 10:42 AM   #9
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Red face

Quote:
Originally Posted by scasey View Post
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.
 
Old 12-12-2020, 11:33 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
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.
 
Old 12-12-2020, 01:08 PM   #11
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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
 
Old 12-12-2020, 02:10 PM   #12
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
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.
 
Old 12-12-2020, 02:26 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
There are a few...

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.

https://www.tecmint.com/set-time-tim...tectl-command/

Last edited by michaelk; 12-12-2020 at 02:28 PM.
 
Old 12-12-2020, 04:13 PM   #14
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
$tzselect

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..

so, where the tzelect result went to ?

thx
 
Old 12-12-2020, 04:56 PM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
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.

Have you restarted the laptop yet?

Is desktop time / date still wrong?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Weird time changes, correct time and date but wrong hour metaschima Slackware 24 08-03-2014 01:14 PM
/root drained up all the disk space ben randall Linux - Server 11 07-15-2009 11:08 PM
how to convert windows date and time to unix date and time jitupatil_2007 General 8 03-31-2008 05:58 AM
Start Date + Time Duration = End Date/Time calculator? ToBe Linux - General 3 09-26-2005 10:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration