[libvirt] [PATCHv2 1/4] util: new function virTimeLocalOffsetFromUTC

Laine Stump laine at laine.org
Fri May 23 16:54:41 UTC 2014


On 05/23/2014 05:45 PM, Laine Stump wrote:
> On 05/22/2014 10:03 PM, Eric Blake wrote:
>>
>> It would be a LOT simpler to just do:
>>
>> #include <time.h>
>>
>> tzset();
>> *offset = timezone;
>>
>> except that some older builds of mingw lack the extern variable
>> timezone.  Or maybe even do a configure check, for
>> AC_CHECK_DECLS([timezone]) (untested, just throwing out the idea), and
>> having #if HAVE_DECL_TIMEZONE with the short code and the #else clause
>> using this dance as the fallback for mingw?  Or even just ditch older
>> mingw?  I see this in Fedora 20's cross-packages for mingw:
> I'm so sick of this topic right now that I'd prefer leaving as is,
> although that is tempting.
>
> Let me think about it for the next couple hours and get back to you.

Okay, I implemented this and the two tests I just added that checked DST
started to fail. It appears that timezone doesn't account for DST. So
unless there is also a standard way to get that information from a
global, I think it would be cleaner just to forget about the global
timezone and have the single implementation




More information about the libvir-list mailing list