Time Zone Support #zephyr
I've got a question concerning time zone support: Does Zephyr provide any functions for converting UTC to other time zones?
I have not found anything about it in the docs aside from the standard functions (gmtime,...) which do not help me since I do not know the UTC offset nor the daylight saving status.
If this is not currently supported in Zephyr, will it be in the future?
Also, does anyone have experience with external libraries for that purpose?
Thanks in advance.
Best Regards
Hi there,
Zephyr supports both newlib and picolibc, which are fully-featured C standard libraries.
Unless I am mistaken timezone-conversion functions are part of the C standard library (<time.h>), so I believe you should be able to use those.
Carles
Sent: 21 December 2022 14:07
To: users@...
Subject: [Zephyr-users] Time Zone Support #zephyr
Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. |
Hi,
I've got a question concerning time zone support: Does Zephyr provide any functions for converting UTC to other time zones?
I have not found anything about it in the docs aside from the standard functions (gmtime,...) which do not help me since I do not know the UTC offset nor the daylight saving status.
If this is not currently supported in Zephyr, will it be in the future?
Also, does anyone have experience with external libraries for that purpose?
Thanks in advance.
Best Regards
thanks for the hints. I've looked into newlib and picolib but found no way to do it since the functions used in the Zephyr tests `tzset()` and `setenv()` are not supported by Zephyr according to the documentation https://docs.zephyrproject.org/3.2.0/services/portability/posix.html .
So I kept researching and found another solution (in case anybody else faces the same problem): the Micro Time Zone Library https://github.com/josmithua/utz .
Best regards