Skip to main content

TcxSchedulerDateTimeHelper.DayToStr(TDateTime,Integer,Boolean) Method

Converts a date into a formatted date string.

Declaration

class function DayToStr(const ADate: TDateTime; AFormat: Integer; ACompressed: Boolean): string; virtual;

Parameters

Name Type
ADate TDateTime
AFormat Integer
ACompressed Boolean

Returns

Type
string

Remarks

The ADate parameter specifies the date to be converted into a string;

The AFormat parameter specifies a string pattern for the date’s representation;

The ACompressed parameter specifies whether the string returned should contain the ADate date and the date following the ADate date. Set the ACompressed parameter to True to return a string containing both dates. Otherwise only the string containing the ADate date will be returned.

The following table shows the available forms for the date string if the ACompressed parameter is set to False:

AFormat Description
0 Return the date string as the full name of the day, full name of the month and the day number
1 Return the date string as the full name of the day, the short version of the month’s name and the day number
2 Return the date string as the short version of the day’s name, the short version of the month’s name and the day number
3 Return the date string as the short version of the day’s name and the day number
4 Return the date string as the month’s number and the day number

Note

the order of the date elements in the string and their formats vary depending upon the host environment’s settings.

The following table lists the available forms for the date string if the ACompressed parameter is set to True:

AFormat Description
0 Return the date string as the full names of the two days and the ADate‘s day number
1 Return the date string as the short version of the day names of the two days and the ADate‘s day number
2 Return the date string as the day numbers of the two days
3 Return the date string as the day numbers of the two days
4 Return the date string as the day numbers of the two days
See Also