Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The FormatDateTime function can be used to format a Unix timestamp in Delphi.

Here is an example:

var
  UnixTimeStamp: Int64;
begin
  UnixTimeStamp := UnixToDateTime(1625072399); // Convert Unix timestamp to Delphi TDateTime
  ShowMessage(FormatDateTime('dd/mm/yyyy hh:nn:ss', UnixTimeStamp)); // Format TDateTime as a string
end;

In this example, the UnixToDateTime function is used to convert the Unix timestamp to a Delphi TDateTime value, which can then be formatted as a string using the FormatDateTime function. The format string 'dd/mm/yyyy hh:nn:ss' represents the desired output format of the timestamp.