Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - QNX equivalent to timegm() ?: (3 Items)
   
QNX equivalent to timegm() ?  
I have a struct tm filled with UTC calendar time that I would like to transpose to time_t in order to convert to 
localtime.
Linux has timegm() for this, but I can't find a QNX equivalent.
Is there a QNX equivalent to timegm()?

Thank you!
Re: QNX equivalent to timegm() ?  
just use mktime. 
timegm is the same of  mktime except it always takes the input values to be UTC 
regardless of any local time zone setting. 
to use mktime as timegm, set the TZ environment variable to UTC, call mktime, then set TZ back. 
bye
mario
Re: QNX equivalent to timegm() ?  
That works!
Thanks Mario