FormatDateTime
Previous  Top  Next

Prototype

StrOutput:=FormatDateTime (strFormat, floatDateTime)

Description

It converts date and time into a string, by using the format mask (strFormat).

Parameters

StrFormat:
string can contain characters Y (Year) , M (Month) , D (Day), H (Hour), N (Minutes), S (Seconds), Z (Millesimi).

FloatDateTime:
real numeric value, representing date and time, that has to be converted into string.

Returned value

StrOutput
: output string .

Notes

Dates and hours are considered as real numbers that represent the days that have been spent since 01/01/1980. A date, so, contains one hour if the representing number has a fractionary part, otherwise if the number is integer, it contains only a date.

Example

//It stores  date and hour
DateHour:=Now;

//It converts date and hour into string 
DateHourStr:=FormatDateTime('DD/MM/YYYY HH:NN:SS',DateHour);

//It shows a message with date e hour
ApplicationLog(_CurrentAgent,'Date and hour:' + DateHourStr);