Hi,
I'm currently migrating some of my code from Cocoa (Apple's Objective-C API) to C, in order to make it available for other operating systems, such as GNU/Linux.
In Cocoa, there were many great things like creating NSTimeZone objects from their string descriptors using timeZoneWithAbbreviation:
. This allowed me to use values like "Europe/Paris" to easily create NSTimeZone objects.
Another important method for me was secondsFromGMTForDate:
because it automatically considers DST rules for you.
Right now, the closest thing to NSTimeZone I've found for C is the struct timezone
(see here). However, I do not see how I can easily get the GMT "offset" in seconds for a specific time and timezone. Neither do I understand how to get timezone structs if you only have a description like "Europe/Paris".
I'm sorry if all this sounds trivial, but I haven't found any good example on this!
Thanks for any help!
-- Marc