We have an embedded Linux system where the user needs to be able to permanently set the system's timezone by supplying a POSIX string (e.g. WEuropeStandardTime-1DaylightTime,M3.5.0,M10.5.0/3).
The user interacts with the system over a webservice we develop so we have complete control of the implementation. I'm looking for a C/C++ solution.
I've been looking at timedatectl -set-timezone, but it only accepts Olson timezone descriptions, not POSIX timezone strings. I was thinking I could parse the tzdata to find a match for the POSIZ timezone string, but before starting down that path I'd like to know if there is a better way or if there is already a library to do this conversion.
I've discounted setting the TZ environment variable as it is an override for the system date and time set by timedatectl and it feels like a bodge. Also, I'm not sure how I'd set it early enough that all software running from boot would see the same time.