SliTaz SliTaz Forum

You are not logged in.

#1 2012-09-10 15:05:50

ilgrandere
Member
Registered: 2012-08-22
Posts: 14

[HELP] Clock problems

Hello comunity!

I have a problem with the slitaz clock, it shows me a totaly wrong infromation, 11/09/2008 04:39 AM, with 15 hours and 4 years away from the real date and time...

What can i do to set the proper time?

Greetings.

Offline

#2 2012-09-10 15:14:47

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: [HELP] Clock problems

# tazpkg get-install ntp

# ntpdate -u fr.pool.ntp.org && hwclock -w -u

Offline

#3 2012-09-10 16:02:16

ilgrandere
Member
Registered: 2012-08-22
Posts: 14

Re: [HELP] Clock problems

Thank you Bellard! smile

Offline

#4 2012-10-22 11:50:33

devl547
Administrator
Registered: 2011-06-01
Posts: 285

Re: [HELP] Clock problems

> # tazpkg get-install ntp

> # ntpdate -u fr.pool.ntp.org && hwclock -w -u

We already have busybox with builtin NTP client/server..

Offline

#5 2012-10-22 13:47:24

lmart
Member
Registered: 2011-04-04
Posts: 61

Re: [HELP] Clock problems

@devl547

OK, so how to you set the clock with "busybox with builtin NTP client/server"?

Offline

#6 2012-10-22 20:23:48

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: [HELP] Clock problems

My investigation:

[c]# busybox ntp
ntp: applet not found[/c]
In the output of busybox --help I see ntpd:

[c]# busybox ntpd --help

Command line: busybox ntpd --help

BusyBox v1.18.4 (2012-03-14 03:32:25 CET) multi-call binary.

Usage: ntpd [-dnqNwl] [-S PROG] [-p PEER]...

NTP client/server

Options:
    -d    Verbose
    -n    Do not daemonize
    -q    Quit after clock is set
    -N    Run at high priority
    -w    Do not set time (only query peers), implies -n
    -l    Run as server on port 123
    -S PROG    Run PROG after stepping time, stratum change, and every 11 mins
    -p PEER    Obtain time from PEER (may be repeated)[/c]
See ya!

+++

[c]root@slitaz:/home/tux# busybox ntpd -dnqp fr.pool.ntp.org
ntpd: sent query to 88.191.88.195
ntpd: reply from 88.191.88.195: reach 0x01 offset 0.066334 delay 0.073731 ↵
status 0x24 strat 2 refid 0x14025dc0 rootdelay 0.001678
ntpd: sent query to 88.191.88.195
ntpd: reply from 88.191.88.195: reach 0x03 offset 0.067031 delay 0.074315 ↵
status 0x24 strat 2 refid 0x14025dc0 rootdelay 0.001678
ntpd: sent query to 88.191.88.195
ntpd: reply from 88.191.88.195: reach 0x07 offset 0.066614 delay 0.074110 ↵
status 0x24 strat 2 refid 0x14025dc0 rootdelay 0.001678
ntpd: sent query to 88.191.88.195
ntpd: reply from 88.191.88.195: reach 0x0f offset 0.066482 delay 0.072698 ↵
status 0x24 strat 2 refid 0x14025dc0 rootdelay 0.001678
ntpd: sent query to 88.191.88.195
ntpd: reply from 88.191.88.195: reach 0x1f offset 0.065155 delay 0.078656 ↵
status 0x24 strat 2 refid 0x14025dc0 rootdelay 0.001678
root@slitaz:/home/tux#[/c]
………

Offline

#7 2012-10-23 14:07:24

lmart
Member
Registered: 2011-04-04
Posts: 61

Re: [HELP] Clock problems

@Aleksej

thanks, one question

    root@slitaz:/home/tux# busybox ntpd -dnqp fr.pool.ntp.org

tux@slitaz:~$ su

Password:

root@slitaz:/home/tux# /home/tux# busybox ntpd -dnqp fr.pool.ntp.org

sh: /home/tux#: not found

root@slitaz:/home/tux#

#1 - unsure what command I use and

#2 - where to find the local npt to replace your "fr.pool.ntp.org"

Offline

#8 2012-10-23 15:27:37

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: [HELP] Clock problems

Oh man! wink

Looks like you're new to Linux.

When you see next command:

[c]root@slitaz:/home/tux# busybox ntpd -dnqp fr.pool.ntp.org[/c]

you want to understand that root@slitaz:/home/tux# is command line prompt, and busybox ntpd -dnqp fr.pool.ntp.org is actually a command. I just copy my terminal to my post. My prompt includes:

[*]current user name: root

[*]symbol @

[*]machine name: slitaz

[*]symbol :

[*]current path: /home/tux

[*]symbol # indicates root user, or symbol $ indicates unprevileged user

For choosing your nearest ntp server go here: http://support.ntp.org/bin/view/Servers/NTPPoolServers

Offline

#9 2012-10-23 21:44:10

lmart
Member
Registered: 2011-04-04
Posts: 61

Re: [HELP] Clock problems

yep - root@slitaz:/home/tux# busybox ntpd -dnqp fr.pool.ntp.org - stupid mistake

thanks for the step-by-step

Offline

#10 2012-10-25 12:08:59

lmart
Member
Registered: 2011-04-04
Posts: 61

Re: [HELP] Clock problems

busybox ntpd -dnqp 0.north-america.pool.ntp.org

still unable to set correct date/time on my system, thoughts?

Offline

#11 2012-10-25 13:35:36

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: [HELP] Clock problems

Copy & paste your terminal here (Sakura terminal → select text (by hold left-mouse-nutton & drag over text, then release left-mouse-button) → switch to forum → press middle-mouse-button in text field (to paste selected text). Or attach screenshot.

I have not any problems with your command.

By the way, NTPD fetches date/time from high-class precision time servers and set your system clocks (system clock is not hardware clock). Do you properly set your timezone? (SliTaz menu → Settings → Time Zone configuration)

Offline

#12 2012-10-25 14:23:34

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: [HELP] Clock problems

That's why Bellard suggested [c]hwclock -w -u[/c] because it sets the hardware clock with the system clock's time.

Offline

#13 2012-10-25 14:39:40

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: [HELP] Clock problems

Yes, there is two steps in Bellard's code:

[*]set system clocks from internet

[*]set hardware clocks from system clocks.

Yes, I describe only first step, while second step is optional and unchanged.

So, here combined command to set system clocks and hardware clocks from internet:

[c]busybox ntpd -dnqp north-america.pool.ntp.org && hwclock -w -u[/c]

Offline

#14 2012-10-25 15:43:35

lmart
Member
Registered: 2011-04-04
Posts: 61

Re: [HELP] Clock problems

thanks all

off by 7+ hours, see attached screenshot

[attachment=17714,736]

Offline

#15 2012-10-25 16:09:04

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: [HELP] Clock problems

... did you change the timezone to the right one? Go to Applications--> Preferences--> Time Zone Configuration

You may need to install glibc-locale to get all the possible timezones.

Offline

#16 2012-10-25 16:16:57

lmart
Member
Registered: 2011-04-04
Posts: 61

Re: [HELP] Clock problems

@Trixar_za; thx, yes set timezone before executing @Aleksej's suggestion

will fall back to @Bellard suggestion and close out this post if it works

interesting, if you follow this post, it is one big circle

@ilgrandere has the same problem as mine

@Bellard suggests the fix you recommend

@devl547 suggests not necessary to execute @Bellard suggestion

Offline

#17 2012-10-25 16:17:32

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: [HELP] Clock problems

@Imart

Your i.p. location indicates Plano,Texas which is on CentralDaylightTime (CDT)

Applications/Preferences/Time Zone configuration

America/Mexico_City

OK

Close X session : exit

Login

Time should be correct

Offline

#18 2012-10-25 16:18:10

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: [HELP] Clock problems

Did you restart the computer after setting the timezone?

Offline

#19 2012-10-25 16:38:15

lmart
Member
Registered: 2011-04-04
Posts: 61

Re: [HELP] Clock problems

@mojo

whew, can the magic you worked getting my timezone tell you my blood type too?  ;-)

here is exactly what it required to set the proper date/time

#1 per @mojo

        Applications/Preferences/Time Zone configuration, set to timezone, OK

#2 per @Bellard

        tazpkg get-install ntp

        ntpdate -u north-america.pool.ntp.org && hwclock -w -u

#3 per @mojo

        Close X session : exit

        Login

        Time is correct

Offline

#20 2012-10-25 18:28:16

lmart
Member
Registered: 2011-04-04
Posts: 61

Re: [HELP] Clock problems

CORRECTION:

after rebooting the system and, starting with a clean slate, here is exactly what is required to set the proper date/time

#1 per @mojo

Applications/Preferences/Time Zone configuration, set to timezone, OK

#2 per @Bellard & @Aleksej

busybox ntpd -dnqp north-america.pool.ntp.org && hwclock -w -u

#3 per @mojo

Close X session (logout button) : exit

Login

Time is correct

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.022 seconds, 7 queries executed - Memory usage: 1.56 MiB (Peak: 1.77 MiB) ]