From 28393b8341f875c5e963193a57f09762c9f0ad39 Mon Sep 17 00:00:00 2001 From: drewcassidy Date: Mon, 1 Jan 2018 00:43:06 -0800 Subject: [PATCH] ugh linux --- _posts/2018-01-01-Raspbian-ntpd.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 _posts/2018-01-01-Raspbian-ntpd.md diff --git a/_posts/2018-01-01-Raspbian-ntpd.md b/_posts/2018-01-01-Raspbian-ntpd.md new file mode 100644 index 0000000..0cbf08f --- /dev/null +++ b/_posts/2018-01-01-Raspbian-ntpd.md @@ -0,0 +1,27 @@ +--- +title: Time-Zones and ntpd in Raspbian +tags: Raspberry-pi linux +--- +Setting the time zone in raspbian using `raspi-config` has strange results +``` +Current default time zone: 'US/Pacific-New' +Local time is now: Mon Jan 1 08:02:07 PST 2018. +Universal Time is now: Mon Jan 1 16:02:07 UTC 2018. +``` + +setting the time zone to GMT-8 manually is even weirder +``` +Current default time zone: 'Etc/GMT-8' +Local time is now: Tue Jan 2 00:02:46 +08 2018. +Universal Time is now: Mon Jan 1 16:02:46 UTC 2018. +``` + +The solution is to shut down ntpd while changing the time zone +``` shell +sudo /etc/init.d/ntp stop +sudo raspi-config #set time zone +sudo date -s "1 Jan 2018 00:09:00" +sudo /etc/init.d/ntp start +``` + +And yes, I did spend New Years debugging time zones in Linux, among other things.