How to set the system date time?

Stefan Jaritz


I have a question about date and time generation in ZephyrOS.

Current I am building a demo in which I am receiving samples. Now I like to add a timestamp to them. How can I do this in ZephyrOS? and how to get the best time resolution?

When runing several devices in parallel I like to sync the time of them. So I like to set the local system time.  How can I do this?

I am thinking using the time.h lib. I can get the current time via the "time(NULL)" call. There is no official way in the ANSI C lib to set the sys date & time. So Zephyr has it's own. How I can use external timers/RTC?

Kind regards!