[Solved] Timestamp decoding problem lazarus / 62-General ---------------------------------------------------------------------- pebe · 2022-02-20 11:27 Hey. I'm having trouble decoding a timestamp. Example: Value: 1622033388513 Decoded in JavaScript gives: (I believe this is the correct answer) Code: [Select]new Date(1622033388513) Result: Wed May 26 2021 14:49:48 GMT+0200 new Date(1622033388513).toLocaleString() Result: 26.05.2021, 14:49:48 Decoded in FP: (rather wrong) Code: [Select]var   timestamp:Comp {int64}   DT:TDateTime; begin   DT:=TimeStampToDateTime(MSecsToTimeStamp(Timestamp));   writeLn(FormatDateTime('YYYY.MM.DD hh:nn',DT));  end; Result: 0052.05.25 12:49:48[/tt] (rather wrong) How to do it correctly? ---------------------------------------------------------------------- bytebites · 2022-02-20 11:42 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses dateutils; DT:=UnixToDateTime(timestamp div 1000,false); ---------------------------------------------------------------------- pebe · 2022-02-20 11:50 Thanks. It works perfectly. I would not have found this feature