[fpc-pascal] How to convert ISO format string in FreePascal

José Mejuto joshyfun at gmail.com
Tue Apr 27 19:05:51 CEST 2010


Hello FPC-Pascal,

Tuesday, April 27, 2010, 5:43:30 PM, you wrote:

FC> I switched to using the unixtime value which is also present in the
FC> records I am using, but it does not allow for Daylight Savings Time
FC> and is currently an hour behind. Is there some way the FreePascal
FC> libraries can adjust for DST? Is there some other unit I can use or
FC> work through?
FC> 1272379859.203125 gives 2010-04-27 14:50:59 instead of 2010-04-27
FC> 15:50:59 in the UK.
FC> My current code is based on "TDateTime(25569 + (StrToInt(epoch) *
FC> 1.0)/86400.0)".

If you want DST time in "historic" mode you can use PascalTZ
http://wiki.lazarus.freepascal.org/PascalTZ as unixtime is GMT.

-- 
Best regards,
 José




More information about the fpc-pascal mailing list