Skip to main content

DateTimeToTextEx(TDateTime,Boolean,Boolean,Boolean) Method

Converts a TDateTime value to a string.

Declaration

function DateTimeToTextEx(const ADate: TDateTime; AIsMasked: Boolean; AIsDateTimeEdit: Boolean = False; AFourDigitYearNeeded: Boolean = False): string;

Parameters

Name Type
ADate TDateTime
AIsMasked Boolean
AIsDateTimeEdit Boolean
AFourDigitYearNeeded Boolean

Returns

Type
string

Remarks

The DateTimeToTextEx function converts a TDateTime value to a string. If the AIsMasked parameter is False, the function simply calls DateTimeToText, passes the ADate parameter to it and returns its result. If the AIsMasked parameter is True, the function performs the following steps:

  1. Gets the ShortDateFormat value.

  2. Corrects it to use in masked editor mode.

  3. Makes up the date format based on the previous two steps.

  4. Formats the ADate parameter value according to the format made up.

  5. Returns the formatted human readable string containing a value of the ADate parameter.

See Also