The FormatDateTime function converts a DateTime value into a String data type, using a provided date and time format specifier Format - see Date And Time Format Specifiers.

This is commonly used when you need to build a String and concatenate a Datetime value.

For a more in-depth explanation of this function, please refer to FormatDateTime.

Declaration: Function FormatDateTime(const Format : string; DateTime : TDateTime) : string

A simple example follows.

procedure OnMapEvent(var Value:Variant);
var MyDate : TDateTime
begin
MyDate := Now;
Value := FormatDateTime('dd/mm/yyyy hh:nn',MyDate);
end;