[ntp:questions] ntpq -crv gives results in local time, not UTC
Gom
gom at gom.invalid
Fri Apr 6 10:19:19 UTC 2012
>
> I agree that my solution is fraught with cost and can imagine others
> reaching different decisions. I would much prefer if Windows were
> clever enough to use the UTC offset in effect at the given time when
> converting between UTC and local -- instead, it always uses the
> current UTC offset essentially pretending daylight savings doesn't
> exist. Worse, applications can't work around it without rewriting the
> bulk of Windows UTC/localtime conversion code, either relying on the
> undocumented Windows timezone information in the registry, or using
> the open source Olsen stuff and taking on keeping it up to date.
>
Hi,
I'm not sure sure I understand what you are meaning.
You state Windows (the OS) doesn't manage correctly the conversion from
local to UTC, but when does the OS do that ? Isn't this more of a
software issue ?
So yes, if you use C or Win32 librairies, mapping Local to UTC can be a
pain, specifically with the DST settings. There is no easy time mapping
library.
But with .Net, there is since the 3.5 release the TimeZoneInfo class
that will do automatically all the mappings you want. See
http://msdn.microsoft.com/en-us/library/system.timezoneinfo.aspx
So there are tools to do good time mappings, but they are not available
under basic C.
Or maybe didn't I understand what you meant by "Windows misrepresents
historical or future timestamps" ??
Thanks
More information about the questions
mailing list