2

So on debian I can change the timezone by running

 # dpkg-reconfigure tzdata

Is there a way to have it recognise this automatically (say if I travel to a different timezone and connect to a wifi network there)? I know my (Android 4.4/CM) phone did this automatically.

I was expecting NTP to do this, but so far it hasn't (after 28 mins of uptime, haven't rebooted since adding the wifi).

If NTP should do this, is there a way I can prod the running ntpd service into re-checking the timeservers/timezone and setting the clock immediately?

$ uname -srvmpio
Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) x86_64 unknown unknown GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.2 (jessie)
Release:        8.2
Codename:       jessie
  • 1
    Your phone actually uses the mobile network to get the TZ information, as its part of the data sent from the carrier. Wifi, on the other had, does not provide that kind of information and would have to defer to the very inaccurate IP geo-location, which is why its not done. – heavyd Oct 20 '15 at 6:31
  • 1
    Time-Zone DHCP option (RFC 4833) – TOOGAM Oct 20 '15 at 6:37
  • @heavyd Ohh thanks! I did wonder how it got it when roaming data was disabled. Should've cottoned on really from that, but brain not working currently. – allicoder Oct 20 '15 at 6:55
  • @heavyd: Wifi can be used for this though – both Google and Mozilla have their network databases which can roughly pinpoint your location based on signal strength of nearby networks. – grawity Oct 20 '15 at 7:01
1

NTP doesn't recognize timezones by itself.

There are tools that do that for you though. Maybe take a look at tzupdate on GitHub which sets your timezone to the location it found via geolocation.

0

GNOME has recently added this feature; it relies on geoclue2 for detecting your current location (based on Google's or Mozilla's nearby Wi-Fi network databases), and systemd-timedated for actually setting the timezone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.