Threadsafe way to convert time between hours

I am writing an application to convert utc-time to different time intervals, now I can use something like this

putenv("TZ=TIMEZONE1"); 
tzset()
...
do time conversions

but I don’t think it is thread-safe, is there also any C / C ++ library that can do the timezone conversion by taking timezone as an argument to the function instead of being global

+3
source share
2 answers

Boost.DateTime supports time zone conversions.

+2
source

, /​​, . - , , .

fork , , waitpid . , , , fork . , 1 fork 2-3 pthread_create , 1 pthread_create 2-3 open . - , , , 3-5 . , , , .

+3

All Articles