Re: updating system with local time


Ross Burton <ross@...>
 

On Tue, 4 Jan 2022 at 14:58, Arik Kleiman <arik.kleiman@...> wrote:

I don't have option to add systemd.

Added alrady tzdata and all time zone folders exist.
The issue is that ntpdate returns time in UTC.

I found a way to get local time zone (by using ip lookup). Now i looking for a way to use it to update system time
Just write a small tool to map the local timezone from the IP lookup
to a timezone name (such as Europe/London) and write it to
/etc/timezone. You could do that with a short ifup script.

That said, for headless appliances working in UTC is absolutely fine,
and for user-facing devices it's perfectly acceptable to ask the user
what the timezone is, as your geo-IP lookup might be incorrect anyway.

Ross

Join yocto@lists.yoctoproject.org to automatically receive all group messages.