[TZDB for Delphi] Encountered issue using TBundledTimezone on LINUX
Hello, I'm working on the development of a software that uses the TZDB for Delphi to deal with the timezones' management, and I'd like to have your opinion about a problem that we are facing. In a procedure, in order to decompose the periods of a timezone, we have to know the timezone's year of a UTC DateTime. To do so, we are using these commands : thisBundledTimezone := TBundledTimeZone.GetTimeZone('America/Los_Angeles'); timeZoneYear := YearOf(IncMinute(aUTCDateTime, Round(thisBundledTimezone.UtcOffset.TotalMinutes))); This is fine if the program is running on Windows, but it crashes on Linux. The error occurs when we're trying to get the UtcOffset. The TBundledTimeZone can't read the FPeriods[I] in the function GetPeriodAndRule. The thing is that FPeriods is a TList that is not typed (with TCompiledPeriod) and Delphi can't use it this way with Linux. We can by the way see a warning when compiling a project that includes TZDB.pas, telling that TList is deprecated. We have solved the problem by modifying the TZDB.pas unit, but it seems weird to have to do this. We are also using the Decomposer.pas unit, but it doesn't have any problem with Linux because it is already working with typed TLists (function Decompose). Do you have any idea about this issue ? You can check the attachment to see our changes. Thank you in advance for your answer, Best regards, Jean FRAUCIEL Développeur Moteur jfrauciel@kiamo.fr +33 5 47 48 33 20 <33547483320> | [image: logo web] <http://www.conecteo.fr/> [image: logo linkedin] <https://www.linkedin.com/company/conecteo> <https://twitter.com/Conecteo> <https://www.facebook.com/conecteo> Chers clients et partenaires, rejoignez votre espace communautaire <https://my.kiamo.fr/welcome>
On 10/17/18 2:01 AM, Jean Frauciel wrote:
Do you have any idea about this issue ?
Sorry, no; Delphi/FPC Time Zone Database is a project that's downstream from us. I suggest contacting its maintainers. I didn't know about that project until just now, and installed the attached proposed patch to document it.
participants (2)
-
Jean Frauciel -
Paul Eggert