Tag Archive
ASP.NET Asus p4C800 Blogging blog updates c# Color Codes Color Hex Codes compair Drupal and WordPress corporate networks cpu errors Delphi delphi Prism Delphi Prism 2010 Delphi RAD dll Drupal easy blogging Firebird GAC GacUtil Google Maps Google Maps not displaying hardware HTML IE6 Intel Intel servers Microsoft Visual Studio modules motherboard Online Writing pascal Plagiarism programmign Programming PublicKeyToken Quiet Mouse Self.AutoPostBackControl Stealing Articles system fail cpu test TDateTime Triond Unix Timestamp Visual Studio 2010 tricks WordPress
How to convert between Delphi TDateTime and the Unix timestamp format
I recently had to convert between Delphi TDateTime and Unix timestamps. The issue is that the two formats are quite different. Delphi uses a float where the integer part is the date, and Unix uses an integer count of the seconds since 1/1/1970.
After a bit of looking around, this is what I ended up using:
style="font-family: Courier New,Courier,monospace; margin-left: 40px;" class="">constUnixStartDate: TDateTime = 25569.0; // Sets UnixStartDate to 01/01/1970
SecondsPerDay = 86400;