TDateTimePicker 設置日期顯示格式

來源:互聯網
上載者:User

 

在TDateTimePicker 設置日期顯示格式為'2010/01/01'需要把Format屬性設為'yyyy/MM/dd'property Format: String;

Description

Format specifies custom
format string for the date-time display, overriding the control panel strings. A
custom format can include both date and time fields, but time fields are not
editable unless the Kind property is dtkTime. The following format characters
are understood.

Element  Description  
d  The one- or two-digit day.

dd  The two-digit day. Single-digit day values are preceded by a zero.

ddd  The three-character weekday abbreviation.
dddd  The full weekday
name.
h  The one- or two-digit hour in 12-hour format.
hh  The two-digit
hour in 12-hour format. Single-digit values are preceded by a zero.
H  The
one- or two-digit hour in 24-hour format.
HH  The two-digit hour in 24-hour
format. Single-digit values are preceded by a zero.

m  The one- or
two-digit minute.
mm  The two-digit minute. Single-digit values are preceded
by a zero.
M  The one- or two-digit month number.
MM  The two-digit
month number. Single-digit values are preceded by a zero.
MMM  The
three-character month abbreviation.
MMMM  The full month name.
t  The
one-letter AM/PM abbreviation (that is, AM is displayed as "A").
tt  The
two-letter AM/PM abbreviation (that is, AM is displayed as "AM").
yy  The
last two digits of the year (that is, 2001 would be displayed as "01").

yyyy  The full year (that is, 2001 would be displayed as
"2001").

To include literal strings in the format, enclose them in single
quotes. Failing to quote literal strings can have unpredicable results, even if
they do not include formatting codes. Use two single quotes to represent one
single quote character in literal string. For example,

'Today''s date:'
MMM dd, yyyy

formatted for the first day of April, 2001, would display
"Today's date: Apr 01, 2001".  

 

來自:
booktian
, 時間:
2003-10-21 15:38:00,
ID:
2243934datetimepicker1.Perform(DTM_SETFORMAT, DWORD(NIL),
DWORD(PCHAR('yyyy-MM-dd')));

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.