Hi Peter, Thank you so much! This is exactly the piece of information I have been looking for. However, my investigation of the GetTimeZone method in the Windows unit exposes only a few of the records of the Microsoft _TIME_ZONE_INFORMATION type. I failed when I tried to access the methods and properties of the class TimeZoneInformation exposed in the library file "mscorlib.dll." But, I could query the registry keys:
"HKLM\System\CurrentControlSet\Control\TimeZoneInformation\" and "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Time Zones\" to retrieve the currently set time zone information on the machine. Considering the fact that a record key doesn't always represent the same chunk of information in all versions of Windows, I think it is more accurate to query the registry. But, thank you. I just wanted to share my findings on the forum. Emmanuel --- In delphi-en@yahoogroups.com, "Peter Luijer" <p.lui...@...> wrote: > > Why didn't you say so in the first place? > > You can use "GetTimeZoneInformation()" from the Windows-unit to get that. > > ======================================================== > > procedure TForm1.Button1Click(Sender: TObject); > Var > ZoneInfo : TTimeZoneInformation; > begin > GetTimeZoneInformation(ZoneInfo); > ShowMessage(Format('Bias with UTC = %d minutes', [ZoneInfo.Bias])); > end; > > ======================================================== > > Greetz, > > Peter. > ________________________________________ > From: delphi-en@yahoogroups.com [mailto:delphi...@yahoogroups.com] On Behalf > Of emmanuellamy > Sent: vrijdag 6 augustus 2010 14:18 > To: delphi-en@yahoogroups.com > Subject: [delphi-en] Re: Converting local to UTC time > > > Thank you, Ray. But my problem is in extracting the local machine timezone > rather than computing the UTC time or local time. > > Emmanuel >