How to get the property value of Tdatetimepicker control in Delphi

Source: Internet
Author: User
Tags month name

Reference: http://www.delphipages.com/forum/showthread.php?t=103412
  
 
  1. var
  2. dtpDate: TDateTimePicker;
  3. begin
  4. dtpDate.Format := ‘yyyy-MM-dd‘;
  5. ShowMessage(‘时间:‘ + FormatDateTime(‘yyyy-MM-dd‘, dtpDate.Date));
  6. //‘yyyy-MM-dd‘是时间显示的格式,更多格式请参照别的资料
  7. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.