Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DateTimeToTextEx(TDateTime,Boolean,Boolean,Boolean) Method

Converts a TDateTime value to a string.

#Declaration

Delphi
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