unable to set time using neither network time nor manually

Hi I am living in India and the system is not displaying correct time in KDE,GNOME… so I have tried to set time by opening *******date and time settings ***from yast and I have selected the option Network Time on even no use and even I have tried to set time locally and it is not accepting my instructions and it assigning date and time randomly.

Please suggest a solution.

Regards,
Rupesh.

Please post the output from:


date
env TZ=GMT date

Could have a dieing battery on the mother board.

On 2013-08-06 20:06, rupeshforu3 wrote:

> Please suggest a solution.

Run this and copy back what you get, inside code tags (complete sequence
in one block, please, with commands, non edited):


su -
date --utc
date --rfc-3339=seconds
hwclock --debug
cat /etc/sysconfig/clock | egrep -v "^:space:]]*$|^#"

Please use code tags. The ‘#’ button - for command outputs and listings
View this
thread for instructions


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

I am providing the output of the commands specified by you below

linux-sfgo:~ # date
>Thu Aug 8 17:30:12 IST 2013
linux-sfgo:~ # env TZ=GMT date
>Thu Aug 8 12:00:16 GMT 2013
linux-sfgo:~ #

linux-sfgo:~ # date --utc
>Thu Aug 8 12:01:56 UTC 2013
linux-sfgo:~ #
linux-sfgo:~ # date --rfc-3339=seconds
>2013-08-08 17:32:42+05:30
linux-sfgo:~ #
linux-sfgo:~ # hwclock --debug
>hwclock from util-linux 2.21.2
>Using /dev interface to clock.
>Last drift adjustment done at 1375924209 seconds after 1969
>Last calibration done at 1375924209 seconds after 1969
>Hardware clock is on UTC time
>Assuming hardware clock is kept in UTC time.
>Waiting for clock tick…
>…got clock tick
>Time read from Hardware Clock: 2013/08/08 12:03:22
>Hw clock time : 2013/08/08 12:03:22 = 1375963402 seconds since 1969
>Thu Aug 8 17:33:22 2013 -0.844644 seconds
linux-sfgo:~ #
linux-sfgo:~ # cat /etc/sysconfig/clock | egrep -v "^:space:]]$|^#"*
>SYSTOHC=""
>FORCE_SYSTOHC=“no”
>BADYEAR=“no”
>HCTOSYS_DEVICE=""
>USE_HWCLOCK=“yes”
>USE_ADJUST=“no”
>TIMEZONE=“Asia/Kolkata”
>DEFAULT_TIMEZONE=“US/Eastern”
linux-sfgo:~ #

On 2013-08-07 06:56, rupeshforu3 wrote:
>
> I am providing the output of the commands specified by you below

Ok - but for next time: Please use code tags. The ‘#’ button - for
command outputs and listings
View this
thread for instructions

(and no bold or anything in the code, please)

I see I forgot to ask for your wall clock time. Was it correct? The
‘IST’ time is your timezone and the time was correct?

> linux-sfgo:~ # -cat /etc/sysconfig/clock | egrep -v
> "^:space:]]
$|^#"*-
>> SYSTOHC=""
>> FORCE_SYSTOHC=“no”
>> BADYEAR=“no”
>> HCTOSYS_DEVICE=""
>> USE_HWCLOCK=“yes”
>> USE_ADJUST=“no”
>> TIMEZONE=“Asia/Kolkata”
>> DEFAULT_TIMEZONE=“US/Eastern”
> linux-sfgo:~ #

Maybe you should adjust the “DEFAULT_TIMEZONE” above. If the wall clock
time matches the output of the plain “date” command, then your system
has the correct time, and do not touch it anymore as root.

If KDE shows incorrect time, then it is ONLY kde problem, and you have
to adjust ONLY kde. Refuse to give it the root password if it asks for it.

KDE has it’s own adjustment for time zone, and its own understanding of
how system time should be set - which may conflict with YaST.

IF the UTC time is incorrect, please say so and we’ll take it from there.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

I’m quoting #5 and adding code tags, to see if that helps.

The posting time for #5 shows for me as 23:51 CDT, Aug 07. And that should be the same as 0451 UTC, Aug 08. So the OPs clock is wrong, since it shows a UTC time several hours later than that.

And please also tell us which openSUSE version you are using, and the output of:

cat /etc/adjtime

Oops! My mistake. The posting time for #5 actually shows as 23:51 CDT Aug 06, which should be the same as 0451 UTC Aug 07. In the meantime, according to #5, the poster’s clock was at Aug 8 12:00:16 GMT 2013, which I take to be just after noon. So the posters clock is out by around 36 hours.

I cant understand the coding disciplines specified by one of you so please help as much as you can

I am providing my OS information and the command specified by one of you below.

linux-sfgo:~ # uname -a
>Linux linux-sfgo.site 3.7.10-1.16-desktop #1 SMP PREEMPT Fri May 31 20:21:23 UTC 2013 (97c14ba) x86_64 x86_64 x86_64 GNU/Linux
linux-sfgo:~ #

linux-sfgo:~ #*** cat /etc/adjtime***
>-85560.141004 1375866307 0.000000
>1375866307
>UTC
linux-sfgo:~ #

They just meant that you should put your computer’s text between [noparse]

 and 

[/noparse] tags (the ‘#’ button in the editor’s toolbar) so it is better readable.

I am providing my OS information and the command specified by one of you below.

linux-sfgo:~ # uname -a

Linux linux-sfgo.site 3.7.10-1.16-desktop #1 SMP PREEMPT Fri May 31 20:21:23 UTC 2013 (97c14ba) x86_64 x86_64 x86_64 GNU/Linux
linux-sfgo:~ #

linux-sfgo:~ #*** cat /etc/adjtime***

-85560.141004 1375866307 0.000000
1375866307
UTC
linux-sfgo:~ #

OK, so you’re running 12.3 and your system is set to keep UTC time in the hardware clock.
There was a bug in 12.2’s ntp package in that it wrote UTC to the hwclock even if your system was set to local time, and that caused the time to jump on every boot. That’s why I was asking.
But you are not affected by this.

Well, do you have ntp configured now or not?
What do you get when you run:

sudo rcntp ntptimeset

Is your time correct then? (check with “date”)

On 2013-08-07 06:56, rupeshforu3 wrote:
>
> I am providing the output of the commands specified by you below
>
>
> linux-sfgo:~ # -date-
>> Thu Aug 8 17:30:12 IST 2013
> linux-sfgo:~ # -env TZ=GMT date-
>> Thu Aug 8 12:00:16 GMT 2013
> linux-sfgo:~ #

Check:


cer@minas-tirith:~> date --utc --date="Thu Aug  8 17:30:12 IST 2013"
Thu Aug  8 12:00:12 UTC 2013
cer@minas-tirith:~>

So both times match. I don’t have your wall clock, but assuming that
your post headers are correct, you posted at “Tue, 06 Aug 2013 22:56:01
MDT”, which is:


cer@minas-tirith:~> date --utc --date="Tue, 06 Aug 2013 22:56:01 MDT"
Wed Aug  7 04:56:01 UTC 2013
cer@minas-tirith:~>

So, your computer is fast by 31 hours!

You should run “rcntp ntptimeset” as wolfi323 says, and if it fails,
post this, inside code tags, please:


su
cat /etc/ntp.conf | egrep -v "^:space:]]*$|^#"


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

I have ran the command ***rcntp ntptimeset ***and got an error so I am providing the output of the command specified by you below.

linux-sfgo:~ # rcntp ntptimeset

Time could not be synchronized

linux-sfgo:~ #

linux-sfgo:~ # cat /etc/ntp.conf | egrep -v “^:space:]]*$|^#”

driftfile /var/lib/ntp/drift/ntp.drift # path for drift file
logfile   /var/log/ntp          # alternate log file
keys /etc/ntp.keys              # path for keys file
trustedkey 1                    # define trusted keys
requestkey 1                    # key (7) for accessing server variables

linux-sfgo:~ #

On 2013-08-08 10:46, rupeshforu3 wrote:
>
> I have ran the command -*rcntp ntptimeset *-and got an error so I am
> providing the output of the command specified by you below.

Do code tags like this, the command has to go ‘in’ as well.


> linux-sfgo:~ # cat /etc/ntp.conf | egrep -v "^:space:]]*$|^#"
>
>     driftfile /var/lib/ntp/drift/ntp.drift # path for drift file
>   logfile   /var/log/ntp          # alternate log file
>   keys /etc/ntp.keys              # path for keys file
>   trustedkey 1                    # define trusted keys
>   requestkey 1                    # key (7) for accessing server variables
>
> linux-sfgo:~ #

You do not have configured any time server. You can do that in YaST (ntp
configuration) or directly edit the file.

This is mine:


Telcontar:~ # cat /etc/ntp.conf | egrep -v "^:space:]]*$|^#"
server 127.127.1.0              # local clock (LCL)
fudge  127.127.1.0 stratum 10   # LCL is unsynchronized
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org
server 0.ch.pool.ntp.org
server 1.ch.pool.ntp.org
server 0.fr.pool.ntp.org
server 0.uk.pool.ntp.org
server 0.es.pool.ntp.org
driftfile /var/lib/ntp/drift/ntp.drift # path for drift file
logfile   /var/log/ntp          # alternate log file
logconfig =all
statsdir /var/log/ntpstat/              # directory for statistics files
filegen peerstats  file peerstats  type day enable
filegen loopstats  file loopstats  type day enable
filegen clockstats file clockstats type day enable
keys /etc/ntp.keys              # path for keys file
trustedkey 1                    # define trusted keys
requestkey 1                    # key (7) for accessing server variables
Telcontar:~ #

Of course, you should try to select time servers in your own country or
near to it.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Thanks a lot for your suggestions and patience my problem is solved. I have solved this issue by selecting ntp configuration from Yast and added public ntp server and now the system is displaying time correctly.

Regards,
Rupesh.

On 2013-08-08 13:16, rupeshforu3 wrote:
>
> Thanks a lot for your suggestions and patience my problem is solved. I
> have solved this issue by selecting ntp configuration from Yast and
> added public ntp server and now the system is displaying time correctly.

Good! :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)