WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: set or sync time from your local dsl-router  (Read 3369 times)

Offline halma

  • Full Member
  • ***
  • Posts: 164
set or sync time from your local dsl-router
« on: September 22, 2020, 10:55:28 AM »
Hi,

if you wanna set or sync the correct localtime on tinycorelinux from command line without additional packages you can use this command:

my date before syncing from my dsl-router
Code: [Select]
date
Tue Sep 22 14:46:47 CEST 2020

syncing the correct localtime:
Code: [Select]
sudo busybox date -s "$(wget -qSO- INSERT-YOUR-DSL-ROUTER-IP-HERE 2>&1 | grep '^  Date:' | cut -d' ' -f 5-)" -D "%d %b %Y %T %Z"
Tue Sep 22 16:49:10 CEST 2020

after syncing command
Code: [Select]
date
Tue Sep 22 16:49:12 CEST 2020
« Last Edit: September 22, 2020, 11:03:54 AM by halma »
1 + 2 = 6  cause  10 - 6 = 78 ;-) lol

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: set or sync time from your local dsl-router
« Reply #1 on: September 22, 2020, 02:50:21 PM »
Hi halma
Very clever.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: set or sync time from your local dsl-router
« Reply #2 on: September 23, 2020, 04:50:00 AM »
This was just recently discussed on the bb ml. Busybox httpd (by default) does not send that header, so if your router uses busybox, you may have to wget another site.
The only barriers that can stop you are the ones you create yourself.