[fpc-pascal] Convert unix timestamp to TDateTime

Stathis Gkotsis stathis.gkotsis82 at gmail.com
Fri Nov 18 13:54:13 CET 2011


Hello,

   I would like to convert a unix timestamp to TDateTime taking into
account timezone and daylight savings. For example, timestamp:
1308666350 should be converted to: 2011/06/21 16:25:50, assuming GMT+1
timezone in the winter (GMT+2 in the summer). I would like this
conversion to work both during the summer and the winter, meaning that
if I try to convert the above timezone during the winter time, it
should work as well. So, I would like for the conversion to work
similarly to: date -d @1308666350 +%Y/%m/%d\ %H:%M:%S . Is this
something possible?

Thank you,

Stathis



More information about the fpc-pascal mailing list