Whistle Master Posted April 26, 2012 Share Posted April 26, 2012 (edited) 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 April 27, 2012 by Whistle Master Quote Link to comment Share on other sites More sharing options...
WatskeBart Posted April 26, 2012 Share Posted April 26, 2012 Excellent! Great find and finally correct history files for your modules ;) Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted April 26, 2012 Author Share Posted April 26, 2012 The only thing is that you will have to restart crond if you don't set time before it starts otherwise it won't run anymore until you restart it. Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted April 27, 2012 Author Share Posted April 27, 2012 Added another fix for date and time by Prox in first post. Quote Link to comment Share on other sites More sharing options...
WatskeBart Posted April 27, 2012 Share Posted April 27, 2012 I'm using the second fix from Prox it's much cleaner and out-of-the-box like. Seb should implement this in next firmware release ;) Quote Link to comment Share on other sites More sharing options...
Root Ctrl Posted May 1, 2012 Share Posted May 1, 2012 Thanks will give the second fix a go. Quote Link to comment Share on other sites More sharing options...
WatskeBart Posted May 1, 2012 Share Posted May 1, 2012 Thanks will give the second fix a go. It will be included in the next firmware release ;) Quote Link to comment Share on other sites More sharing options...
lester Posted August 28, 2012 Share Posted August 28, 2012 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. Quote Link to comment Share on other sites More sharing options...
barry99705 Posted August 29, 2012 Share Posted August 29, 2012 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.... Quote Link to comment Share on other sites More sharing options...
lester Posted August 29, 2012 Share Posted August 29, 2012 Anyway to make this perform at each restart? Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted August 29, 2012 Share Posted August 29, 2012 Anyway to make this perform at each restart? It does. It is built into the pineapple. As long as it has internet it will get the latest time. Quote Link to comment Share on other sites More sharing options...
lester Posted August 29, 2012 Share Posted August 29, 2012 You mean your time.php script runs automatically without human intervention at startup? Please tell me how to set that up. Thanks! Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted August 30, 2012 Author Share Posted August 30, 2012 This script is not needed anymore as Seb added the feature in the firmware. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.