Time, Time Zone and the total mess… (continued)
- as Jürg has correctly pointed out: gmtime() would have helped me a lot (but isn't portable)
- as I realized during the last week, replacing mktime() with timegm() would have properly helped, too
Going along with timegm() also yields exactly the results that I expected. This makes things a little easier as all the times in my application are UTC times and will properly get converted into local times when using… It also allows things to become a little easier as I can assume that all times in my application are UTC times.
So right now, I'm trying to get the g_timegm() patch into glib, so there is a portable, threadsafe (as in “does neither modify your environment variables nor use static variables”) implementation people can use in their applications.