[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'EditBtn' (#lcl)

# TDateEdit.Date

Contains the TDateTime value for the control.

## Declaration

Source position: editbtn.pas line 636

`public property TDateEdit.Date : TDateTime read GetDate write SetDate;`

## Description

Date is a TDateTime property with the date value for the control. The Time component in the value is ignored in TDateEdit. Date is a public property, so it is not available in the Object Inspector at design-time. But its value can be assigned in program code at run-time.

Date provides the value displayed and updated using the Edit for the control when DirectInput is enabled. It is updated when the Button for the control is clicked and a new value is selected from the calendar dialog.

Setting a new value for the property causes the new date to be validated. An empty date is represented using the NullDate value. When the property value is NullDate and DefaultToday is enabled, the current system date is used.

MinDate and MaxDate are used (when assigned) to ensure that the new property value is within the specified range of dates. They are not used to limit the value in Date if either of the properties contain NullDate, or are not at least one day apart. When not used, the MinDateTime and MaxDateTime RTL constants are used as the lower and upper limits for the date value.

The value in Text is updated when the new value is stored in the Date property.

Use DateOrder to control the order of the date components displayed on the control and in the Text property. Use DateFormat to specify the FormatDateTime-compatible formatting string used when DateOrder is set to doNone. The default format settings for the locale are used to generate the value in Text when both DateOrder and DateFormat are not used.

## See also

TDateEdit.MinDate |  | Smallest date value allowed in the date edit control.
TDateEdit.MaxDate |  | Largest date value allowed in the date edit control.
TDateEdit.Text |  | String with the text or caption for the control.
TDateEdit.DefaultToday |  | True to use the current system date when a Date value is not available.
TDateEdit.Button |  | TSpeedButton instance used on the edit control.
TDateEdit.DateOrder |  | Controls the display order for Year, Month, and Day parts of the Date value.
TDateEdit.DateFormat |  | Specifies the format string used for the date value in the control.
TDateEdit.DefaultToday |  | True to use the current system date when a Date value is not available.