Jump to content

Date And Time


Recommended Posts

Hi !

I share with you a php script to set the correct date and time for the pineapple. It acts as a ntp client but without installing one such as ntpclient, etc.

It gets UTC time, so you will have to change the following parameter in the code:

// time adjustment
$time_adjustment = 7200;

Download

EDIT

Another fix is proposed by Prox here

in /etc/config/system add the lines:

config 'timeserver'

list 'server' '0.openwrt.pool.ntp.org'

list 'server' '1.openwrt.pool.ntp.org'

list 'server' '2.openwrt.pool.ntp.org'

list 'server' '3.openwrt.pool.ntp.org'

You may also need/want to change line 2 to your local timezone.

option 'timezone' 'UTC'

(Note: timezones are listed here)

Add the command 'date -k' to /etc/rc.local

Info: wiki.openwrt.org/doc/uci/system

Edited by Whistle Master
Link to comment
Share on other sites

  • 3 months later...

What do you mean:

// time adjustment

$time_adjustment = 7200;

is that seconds? minutes? Could you be a bit clearer how this works? When I run it, it shows PDT time which is off by more than two hours from the time in the East Coast.

thank you.

Link to comment
Share on other sites

What do you mean:

// time adjustment

$time_adjustment = 7200;

is that seconds? minutes? Could you be a bit clearer how this works? When I run it, it shows PDT time which is off by more than two hours from the time in the East Coast.

thank you.

It's minutes. Eastern would be -3000, actually I guess it would be -2400 right now. Stupid daylight savings time....

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...