nerves-time / nerves_time

Keep time in sync on Nerves devices
Other
23 stars 13 forks source link

Set and get the device's timezone #79

Closed jfcloutier closed 3 years ago

jfcloutier commented 3 years ago

Associating the device with a timezone and retrieving that timezone. The default timezone is UTC.

fhunleth commented 3 years ago

Linux stores the local time by symlinking /etc/localtime:

$ ls -las /etc/localtime
0 lrwxrwxrwx 1 root root 36 Jan 29 06:15 /etc/localtime -> /usr/share/zoneinfo/America/New_York

This is not ideal for nerves_time. I don't know whether Erlang or Elixir libraries use this file. I'll look.

My hope is that 1. nerves_time is a central place for storing the local timezone if that's desired (I think your PR does that) and 2. whatever timezone is set gets used without Nerves-specific glue code in user applications. I'm less sure that #2 is possible since I've never dug into timezones that deeply, but I'd like to spend some time looking.

fhunleth commented 3 years ago

See https://github.com/nerves-time/nerves_time_zones now.