Posted: Sun Oct 27, 2024 19:50 Post subject: Setup time without ntp or the internet?
I attempted to use a PC app that controls Phillips Hue light bulbs through a Bridge connected to the router. The app complained of incorrect time settings.
The router is not connected to the web or another router that is. Is there a way to set the time on the dd-wrt router? I checked the Setup/Basic Setup page but ran into a dead end.
If I connect the router to the web long enough to set the time, will the correct time be maintained?
Joined: 17 Apr 2014 Posts: 146 Location: SF Bay Area
Posted: Wed Nov 12, 2025 4:35 Post subject: Re: Setup time without ntp or the internet?
jimlynnjulian wrote:
...
The router is not connected to the web or another router that is. Is there a way to set the time on the dd-wrt router?
...
I use the following to set time from router running dd-wrt, to rpi-4 at boot.
Code:
DATE="$( ssh root@<router> date )"
if echo $DATE | grep -q ' P.T 20'; then
date -s "$DATE"
fi
Notes:
* The 'date' command output from the time source must be in a format usable on the router (see below)
* The 'if/then' sanity check is for PST/PDT, not strictly needed.
* If scripted, you need to setup public key ssh between router and PC.
-u Work in UTC (don't convert to local time)
[-s] TIME Set time to TIME
-d TIME Display TIME, not 'now'
-D FMT FMT (strptime format) for -s/-d TIME conversion
-r FILE Display last modification time of FILE
-R Output RFC-2822 date
-I[SPEC] Output ISO-8601 date
SPEC=date (default), hours, minutes, seconds or ns
Recognized TIME formats:
@seconds_since_1970
hh:mm[:ss]
[YYYY.]MM.DD-hh:mm[:ss]
YYYY-MM-DD hh:mm[:ss]
[[[[[YY]YY]MM]DD]hh]mm[.ss]
Joined: 05 Oct 2008 Posts: 852 Location: Helsinki, Finland / nr. Alkmaar, Netherlands
Posted: Tue Dec 09, 2025 22:32 Post subject:
A UPS hat for a raspberry pi may have a real time clock module built in that you could use with your time server.
I use a wittypi L3V7 UPS hat on a pi4 that runs PiHole, unbound and WireGuard on my home LAN.
The NTP server software is Chrony. The wittypi software doesn’t like chrony, but it can be coerced.
On another LAN in a different location I have a similar setup on a pi zero 2, without wireguard.
The router is set up to get the time from the local ntp server. So do most other clients. The chrony ntp server in its turn synchronizes with internet time servers only every 1000 sec.