|
안영제님께서 하신 방법이 맞습니다.
조금 스트링을 바꾸면 됩니다.
void __fastcall TForm1::Button1Click(TObject *Sender)
{
DTP1->Kind = dtkTime;
//DTP1->Format = "yyyy/MM/dd hh:mm:ss tt"; //--> AM/PM 표시
DTP1->Format = "yyyy/MM/dd HH:m:s";
}
도움말을 보시면 상세히 나와 있습니다.
<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").
--------------
시간을 24시로 표시하시려면 대문자 H를 사용하시면 됩니다.
다른 예로 AM/PM도 같이 있습니다.
오늘도 건승을 빕니다.
civilian,안영제 님이 쓰신 글 :
: 그렇군요.
: 현재 빌더 5가 설치되어 있지 않아서 확인이 불가능하네요.
:
: 초보자 님이 쓰신 글 :
: : 제가 5.0을 사용하고 있는데 Object Inspector에 Format 이란 항목은 없거든요.
: : DateFormat 항목에는 입력해도 Invalid property value 라고 나오구요.
: :
: :
: : civilian,안영제 님이 쓰신 글 :
: : : 이상하군요. 오브젝트 인스펙터에서 Format에 값을 직접 넣어보세요.
: : :
: : : 초보자 님이 쓰신 글 :
: : : : 답변 감사드립니다.
: : : :
: : : : 폼 생성시 Show 함수에서 말씀하신대로 입력을 했습니다.
: : : :
: : : : 그런데 컴파일을 하니까
: : : : "Format is not member of TDateTimePicker" error 가 뜹니다.
: : : :
: : : :
: : : :
: : : : civilian,안영제 님이 쓰신 글 :
: : : : : DateTimePicker1->Kind = dtkTime;
: : : : : DateTimePicker1->Format = "hh:mm:ss";
: : : : :
: : : : : 초보자 님이 쓰신 글 :
: : : : : : DateTimePicker 사용시 kind를 dtkTime, DateFormat을 dtShort 로 하면
: : : : : : 오후 9:02:15 이런식으로 표시되는데 이것을 21:02:15 이런식으로 표현하려면 어떻게해야
: : : : : : 하나요?
|