I have a program that was originally written for Linux, but now I have a requirement to get it working on Solaris 10.
Part of this program uses the timegm function to convert a value struct tmto a second value time_t. Input time refers to UTC.
Trying to compile this program on Solaris, it fails because it timegmcannot be found. After some googling, I realized that this feature was removed from Solaris a long time ago (and even the Linux help system recommends not using it because it is not standardized).
However, I have not yet been able to find an alternative function that accepts struct tm, to which UTC refers, and transforms into an era. Most of the links that I found on the network recommend using mktime , however this function interprets inputs with a link to the local time zone of the system.
Please note that I do not want to use tzsetto force the time zone for UTC, as this will have other side effects for the program.
So my question is: how can I convert the struct tmstakeout time expressed in terms of UTC to an era in the absence timegm?
The program is written in C ++, so I am not limited to C-solutions, although I would prefer not to start wholesale processing to use an additional time library.