I'm trying to replicate the functionality of the Windows function GetTimeZoneInformation, which populates a TIME_ZONE_INFORMATION structure, using CoreFoundation. I've made a function that turns a CFAbsoluteTime
along with a CFTimeZoneRef
into the equivalent of a SYSTEMTIME
, but there are a few other things I can't quite figure out. For example:
StandardDate
andDaylightDate
: I've used theCFTimeZoneGetNextDaylightSavingTimeTransition
function to find the next transition, andCFTimeZoneIsDaylightSavingTime
to determine which transition this is, but sinceTIME_ZONE_INFORMATION
requires both dates, how would I find the transition after the next transition?- Similarly,
DaylightBias
- I can useCFTimeZoneGetDaylightSavingTimeOffset
to find the offset if we're currently in DST, but this value goes to zero if we're not currently in DST. I know it's pretty much always -60, but I'd like this function to stay completely faithful to the Windows function.
Does anyone know a good solution for this?