Reference: http://www.delphipages.com/forum/showthread.php?t=103412
var
dtpDate: TDateTimePicker;
begin
dtpDate.Format := ‘yyyy-MM-dd‘;
ShowMessage(‘时间:‘ + FormatDateTime(‘yyyy-MM-dd‘, dtpDate.Date));
//‘yyyy-MM-dd‘是时间显示的格式,更多格式请参照别的资料
end;
Dtpdate.format: = ' yyyy-mm-dd ';
The meaning of the string code in the Format property here is as follows:
Y: one-digit year (2001 is shown as "1"), YY: The last two digits of the year (2001 is displayed as "yyyy"), and the full year (2001 is shown as "2001").
M: one digit or two digit month value; MM: two-digit month value. One digit value is preceded by a 0; MMM: Three characters of the month abbreviation; MMMM: Full month name.
D: a single or double digit number of days; DD: two-digit number of days, one number of days in front plus a zero.
DDD: A three-character weekday abbreviation; DDDD: the full weekday name.
One-or two-digit hours in the h:12-hour format, two-digit hours in the hh:12-hour format, preceded by a 0-digit number, and H: one or two digits in the 24-hour format, and two-digit hours in the hh:24-hour format, preceded by a zero for the one-digit value.
M: single-digit or two-digit minute value; mm: two-digit minute value preceded by a zero for one digit value.
S: one-digit or two-digit seconds; SS: two-digit-second, one-digit value preceded by a zero.
T: am/pm abbreviation for one letter ("AM" is displayed as "a"), TT: two-letter am/pm abbreviation ("AM" is displayed as "AM").
Source: >
From for notes (Wiz)
How to get the property value of Tdatetimepicker control in Delphi