Re: updating system with local time


Arik Kleiman
 

From what i read, there is a way to do this using timedatectl (its part of systemd).

Anyone knows what recipe i need for that?


On Tue, Jan 4, 2022, 16:58 Arik Kleiman via lists.yoctoproject.org <arik.kleiman=gmail.com@...> 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

On Tue, Jan 4, 2022, 15:47 Michael Opdenacker <michael.opdenacker@...> wrote:
Hi Arik,

On 1/4/22 1:15 PM, Arik Kleiman wrote:
> The thing is that ntpdate syncs system time to UTC 
>
> How can i set my system's time according to time zone?


If you're using systemd, you could use the timedatectl command:
https://linuxiac.com/how-to-set-timezone-and-sync-server-time-with-ntp-in-linux/

Otherwise, you can add the "tzdata" recipe to your image. It should
allow you to set the timezone that you want:
https://www.yoctoproject.org/pipermail/yocto/2018-October/042964.html

Cheers
Michael.

--
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com




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