Time is not correct [Solved]

Discussions Regarding Software

Moderator: Moderators

nomko
Young Hen
Posts: 37
Joined: Fri Dec 27, 2013 21:57
Location: The Netherlands

Time is not correct [Solved]

Post by nomko » Tue Dec 31, 2013 19:04

Hi,

I noticed that my time is not correct. It runs 1 hour behind. I tried to adjust it manually but without any succes. How can i adjust it to get the correct time?

Sabayon 14.1 + Cinnamon

Many thanks!
Last edited by nomko on Fri Jan 03, 2014 22:20, edited 1 time in total.
ASUS P5KPL-AM SE*Intel Core2 Quad CPU Q8200*4 GiB ram*nVidia GeForce 9500GT*Realtek RTL8101/8102E*Optiarc DVD-RW AD-7200A*HDD:Samsung HD501LJ/HD103SI*Sitecom X5-N600 Router

User avatar
jundaigrind
Baby Hen
Posts: 4
Joined: Sun Dec 29, 2013 17:08
Location: Salvador, Bahia, Brazil
Contact:

Re: Time is not correct

Post by jundaigrind » Tue Dec 31, 2013 19:40

Hello nomko,

Graphically: go to calendar/hour settings and turn on "Network Time".

Or (more recommended :wink: )

Follow instrunctions in: https://wiki.sabayon.org/index.php?titl ... _Set_Clock

But, if your doubt is related to the time format, see: http://linux.die.net/man/3/strftime

Hug!

Regards,

nomko
Young Hen
Posts: 37
Joined: Fri Dec 27, 2013 21:57
Location: The Netherlands

Re: Time is not correct

Post by nomko » Wed Jan 01, 2014 1:50

jundaigrind wrote:Graphically: go to calendar/hour settings and turn on "Network Time".
Thatś exactly whati did but wothout result. It doesn accept the new time settings.

jundaigrind wrote: Follow instrunctions in: https://wiki.sabayon.org/index.php?titl ... _Set_Clock

But, if your doubt is related to the time format, see: http://linux.die.net/man/3/strftime
I'll try those two pages!
Thanks!
ASUS P5KPL-AM SE*Intel Core2 Quad CPU Q8200*4 GiB ram*nVidia GeForce 9500GT*Realtek RTL8101/8102E*Optiarc DVD-RW AD-7200A*HDD:Samsung HD501LJ/HD103SI*Sitecom X5-N600 Router

nomko
Young Hen
Posts: 37
Joined: Fri Dec 27, 2013 21:57
Location: The Netherlands

Re: Time is not correct

Post by nomko » Wed Jan 01, 2014 16:24

Okay, i tried the wiki and this is the result:

command equo install net-misc/ntp worked, but only with sudo since it requires superuser access.

command ntpdate time-a.nist.gov did not worked. Bash doesn recognize the command ntpdate:
[email protected] ~ $ ntpdate time-a.nist.gov
bash: ntpdate: opdracht niet gevonden
Translated from Dutch it means command not found


What to do now???
ASUS P5KPL-AM SE*Intel Core2 Quad CPU Q8200*4 GiB ram*nVidia GeForce 9500GT*Realtek RTL8101/8102E*Optiarc DVD-RW AD-7200A*HDD:Samsung HD501LJ/HD103SI*Sitecom X5-N600 Router

imaginasys
Simple Hen
Posts: 51
Joined: Sat Nov 23, 2013 6:59

Re: Time is not correct

Post by imaginasys » Wed Jan 01, 2014 17:06

you must be root to change the time.

Check your timezone, if you're on systemd : timedatectl

It will show current time, the time zone, the ntp server you're using, etc.

Regards,
Bernard

nomko
Young Hen
Posts: 37
Joined: Fri Dec 27, 2013 21:57
Location: The Netherlands

Re: Time is not correct

Post by nomko » Wed Jan 01, 2014 18:00

imaginasys wrote:you must be root to change the time.

Check your timezone, if you're on systemd : timedatectl

It will show current time, the time zone, the ntp server you're using, etc.

Regards,
Bernard
I know i have to be root, but how do i now what to use? Every wiki shows rc-update commands which doesn't work at all. And how do i know if i'm using systemd?


Just tried that command and this is what i get:
[email protected] ~ $ timedatectl
Local time: wo 2014-01-01 17:03:38 CET
Universal time: wo 2014-01-01 16:03:38 UTC
Timezone: Europe/Amsterdam (CET, +0100)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: yes
DST active: no
Last DST change: DST ended at
zo 2013-10-27 02:59:59 CEST
zo 2013-10-27 02:00:00 CET
Next DST change: DST begins (the clock jumps one hour forward) at
zo 2014-03-30 01:59:59 CET
zo 2014-03-30 03:00:00 CEST

Warning: The RTC is configured to maintain time in the local time zone. This
mode is not fully supported and will create various problems with time
zone changes and daylight saving adjustments. If at all possible use
RTC in UTC, by calling 'timedatectl set-local-rtc 0'.
ASUS P5KPL-AM SE*Intel Core2 Quad CPU Q8200*4 GiB ram*nVidia GeForce 9500GT*Realtek RTL8101/8102E*Optiarc DVD-RW AD-7200A*HDD:Samsung HD501LJ/HD103SI*Sitecom X5-N600 Router

Cb7
Growing Hen
Posts: 104
Joined: Sun Apr 07, 2013 7:13

Re: Time is not correct

Post by Cb7 » Wed Jan 01, 2014 22:09

nomko wrote:Just tried that command and this is what i get:
Use this one:

Code: Select all

man timedatectl
Why, and how to add "[Solved]" to your post. Please read. ← credits to Fitzcarraldo

Kind regards
~Zetok Zalbavar

imaginasys
Simple Hen
Posts: 51
Joined: Sat Nov 23, 2013 6:59

Re: Time is not correct

Post by imaginasys » Wed Jan 01, 2014 22:45

I have tried the following on my side :

Code: Select all

### 1 check if ntp is active ###
zeus system # systemctl status ntpdate.service
ntpdate.service - Set time via NTP using ntpdate
   Loaded: loaded (/usr/lib64/systemd/system/ntpdate.service; disabled)
  Drop-In: /etc/systemd/system/ntpdate.service.d
           └─00gentoo.conf
   Active: inactive (dead)

### 2 enable the ntp service ####
zeus system # 
zeus system # systemctl enable ntpdate.service
ln -s '/usr/lib64/systemd/system/ntpdate.service' '/etc/systemd/system/multi-user.target.wants/ntpdate.service'

### 3 Start the ntp service ### 
zeus system # systemctl start ntpdate.service

### 4 check the status of ntp service ###
zeus system # systemctl status ntpdate.service
ntpdate.service - Set time via NTP using ntpdate
   Loaded: loaded (/usr/lib64/systemd/system/ntpdate.service; enabled)
  Drop-In: /etc/systemd/system/ntpdate.service.d
           └─00gentoo.conf
   Active: active (exited) since mer 2014-01-01 16:19:04 EST; 12s ago
  Process: 15320 ExecStart=/usr/sbin/ntpdate -b -u $SERVER (code=exited, status=0/SUCCESS)
jan 01 16:19:04 zeus.VIDEOTRON.CA systemd[1]: Started Set time via NTP using ntpdate.

### So the service is a oneshot, it execute at start and die ##
### Let check the date and time ###
zeus system # date
mer jan  1 16:19:29 EST 2014

zeus system # timedatectl
      Local time: mer 2014-01-01 16:19:54 EST
  Universal time: mer 2014-01-01 21:19:54 UTC
        RTC time: mer 2014-01-01 21:20:14
        Timezone: n/a (EST, -0500)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  dim 2013-11-03 01:59:59 EDT
                  dim 2013-11-03 01:00:00 EST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  dim 2014-03-09 01:59:59 EST
                  dim 2014-03-09 03:00:00 EDT

You see that "datetimectl" reports ntp synchronization as not active...
It seems you have to activate it yourself :

### This command will activate ntp ###
zeus bash # timedatectl set-ntp 1

### Confirm that it worked ###
zeus bash # timedatectl
Local time: mer 2014-01-01 16:32:06 EST
Universal time: mer 2014-01-01 21:32:06 UTC
RTC time: mer 2014-01-01 21:32:06
Timezone: n/a (EST, -0500)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
dim 2013-11-03 01:59:59 EDT
dim 2013-11-03 01:00:00 EST
Next DST change: DST begins (the clock jumps one hour forward) at
dim 2014-03-09 01:59:59 EST
dim 2014-03-09 03:00:00 EDT
Done it. Now if you are in the wrong zone you can change it with "timedatectl" again:

to list timezone availables : # timedatectl list-timezones

to set it to your correct timezone : # timedateclt set-timezone Europe/Amsterdam

Note that if you have another OS and you are using local time for your clock all this will not work correctly... I'm only running linux on my machine and have the clock set to GMT time, just read the man pages for "timedatectl" about "set-local-rtc" and you will get the idea.

Good luck,
Bernard

nomko
Young Hen
Posts: 37
Joined: Fri Dec 27, 2013 21:57
Location: The Netherlands

Re: Time is not correct

Post by nomko » Thu Jan 02, 2014 2:20

to set it to your correct timezone : # timedateclt set-timezone Europe/Amsterdam
This is the result:
[email protected] ~ $ timedateclt set-timezone Europe/Amsterdam
bash: timedateclt: opdracht niet gevonden
[email protected] ~ $
bash: timedateclt: command not found
It doesn matter what i try, the bash returns with the message that it can not find the command.....any command!!!!! why is that?????
What is it what you guys have installed what i don't have??????
This is getting on my nerves now, really. I'm willing to learn Sabayon, but like this i have more issues and questions and problems than solutions....

Another thing: my timezone is correct! As you can see in this post.

I don have NTP switched on or even running.

I'm not a whizzkid, i'm a regular user who likes the benefits of working with Linux above Windows and i'm willing to lear, even after using Linux (Ubuntu/Mint) since 2007, i know my way around on those 2 distro's, Sabayonb is for me a step further up the ladder. So,please be gentle and please guide me through this.
ASUS P5KPL-AM SE*Intel Core2 Quad CPU Q8200*4 GiB ram*nVidia GeForce 9500GT*Realtek RTL8101/8102E*Optiarc DVD-RW AD-7200A*HDD:Samsung HD501LJ/HD103SI*Sitecom X5-N600 Router

imaginasys
Simple Hen
Posts: 51
Joined: Sat Nov 23, 2013 6:59

Re: Time is not correct

Post by imaginasys » Thu Jan 02, 2014 4:15

You must use "timedatectl" not "timedateclt" !!! ;=)

Post Reply