Time keeps resetting to 6pm after every reboot

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
Integraoligist
DD-WRT Novice


Joined: 11 Feb 2018
Posts: 13

PostPosted: Sun Feb 11, 2018 11:50    Post subject: Time keeps resetting to 6pm after every reboot Reply with quote
Hi all, I'm trying to setup Express VPN but it will not work because of the routers time... I look at the time and it's reset to 6pm exactly every single time I reboot the router.

I disabled the ntp client, it still resets
I enabled it, and changed the server to pool.ntp.org, it still does it
I change the time zone, that moves the clock... My zone is -6gmt so obviously the clock is just reseting back to 00:00 at every reboot.

In running a TP LINK ARCHER C9 with the latest v3.0

Ideas on what is causing this?
Thanks!
Sponsor
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Sun Feb 11, 2018 13:34    Post subject: Re: Time keeps resetting to 6pm after every reboot Reply with quote
Integraoligist wrote:

In running a TP LINK ARCHER C9 with the latest v3.0
Ideas on what is causing this?

The latest build 34786 has a bug in ntpclient if not process_monitor. So the clock would always be wrong.

Read this thread:
https://www.dd-wrt.com/phpBB2/viewtopic.php?t=313747

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
Integraoligist
DD-WRT Novice


Joined: 11 Feb 2018
Posts: 13

PostPosted: Sun Feb 11, 2018 15:35    Post subject: Reply with quote
Quote:
Here is a command-line that uses curl to get the current time from the HTTP response header:

Code:

* how to get current time in Epoch format by curling Google,with sed and grep to filter un-needed information:

curl -I 'http://www.google.com/' 2&>/dev/null | grep -i '^date:' | sed 's/^[Dd]ate: //g'

Result: Fri, 09 Feb 2018 08:58:49 GMT

* Converting the time into YYYYMMDDHHMM.SS using sed and awk

curl -I 'http://www.google.com/' 2&>/dev/null | grep -i '^date:' | sed 's/^[Dd]ate: //g' | awk 'BEGIN{months=" JanFebMarAprMayJunJulAugSepOctNovDec"}{printf("%s%02d%s%s", $4, index(months,$3)/3,$2,$5)}' | sed 's/://' | sed 's/:/./'

Result: 201802090858.49

* the full command-line by calling "date --utc -s" with "`curl .....`" as parameter

date --utc -s `curl -I 'http://www.google.com/' 2&>/dev/null | grep -i '^date:' | sed 's/^[Dd]ate: //g' | awk 'BEGIN{months=" JanFebMarAprMayJunJulAugSepOctNovDec"}{printf("%s%02d%s%s", $4, index(months,$3)/3,$2,$5)}' | sed 's/://' | sed 's/:/./'`


FYI, you could just paste this command-line into Administration -> Command Shell -> Commands and hit "Save Startup"!




So I added this to the Administration > Commands > Save Startup:
---
date --utc -s `curl -I 'http://www.google.com/' 2&>/dev/null | grep -i '^date:' | sed 's/^[Dd]ate: //g' | awk 'BEGIN{months=" JanFebMarAprMayJunJulAugSepOctNovDec"}{printf("%s%02d%s%s", $4, index(months,$3)/3,$2,$5)}' | sed 's/://' | sed 's/:/./'`
---

But it's not fixing the clock...
Do I also need to add the Curling and Convert string that you have above? And if so, where do I put this?
FYI I'm in the US is this makes a difference.

Thanks again!
Integraoligist
DD-WRT Novice


Joined: 11 Feb 2018
Posts: 13

PostPosted: Sun Feb 11, 2018 15:39    Post subject: Reply with quote
Or is there a good Stable version for this Archer C9 router, and not a Beta what I can install?

I can't seem to find anything for this C9 other then the Beta versions.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum