TimeDate with timezone lazarus / 13-General ---------------------------------------------------------------------- Tom · 2009-05-11 09:30 Hi, I started with a little test application for Win32 and PPC, which is a two timezone clock. Intention is to display the local time and a second time in another timezone. By now, I just disregard any daylight savings and timezone and just substract a few hours to display the correct result, but this will fail as soon as DST changes the wallclock time. Ideally I want to specify in which timezone the PC/PDA currently is (for the "Now" TimeDate), derive UTC from that and then calculate the time in the second timezone from this UTC time. Finally the question: Is there any support in the core libraries for time and date calculations that take timezones into account? I have found a few hints that it might exist for Unix systems, but I want to develop for PPC and Windows. For Delphi there seems to be something like "TTimeZoneInformation", but I cannot find it in Lazarus. Code: [Select]procedure TForm1.Timer1Timer(Sender: TObject); var   here, there : TDateTime; begin   here := Now;   // here i just say the difference is 8 hours, but this will change depending on DST   there := here - EncodeTime(8,0,0,0);   Label1.Caption := FormatDateTime('hh:nn', here);   Label2.Caption := DateToStr(here);   Label3.Caption := FormatDateTime('hh:nn', there);   Label4.Caption := DateToStr(there); end; Thank you for your help and with best regards, Tom