Re: How to convert time from one timezone to another? by Igor
Igor
Thu Jul 24 10:29:05 CDT 2008
Art <artami2006@gmail.com> wrote:
> During DST transitions, I guess just substracting one hour may not
> work.
GMT+1:00 is, by definition, one hour ahead of UTC regardless of DST. It
is possible that some jurisdiction is in GMT+1:00 in winter and in
GMT+2:00 in summer. Is that what you mean? Then you need to specify
timezone in some geographical way, not by a GMT offset.
> Is there any way to get the info from OS.
You mean, the information on the DST rules of a particular jurisdiction?
Not with a public API, as far as I can tell. This information is stored
in the registry under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time
Zones
in an undocumented format (which, reportedly, has changed between XP and
Vista).
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925