var DateTime : TDateTime; str : string; begin DateTime := Time; // store the current date and time str := TimeToStr(DateTime); // convert the time into a string Caption := str; // display the time on the form's caption { Note This could have been done with the following line of code: Caption := TimeToStr(Time); } end;
2 你可以用ftTime类型的字段而不用ftDataTime类型来达到
3 你可以在前台使用formatdatetime达到
formatdatetime('hh:mm',field.value);
DateTime : TDateTime;
str : string;
begin
DateTime := Time; // store the current date and time
str := TimeToStr(DateTime); // convert the time into a string
Caption := str; // display the time on the form's caption
{ Note This could have been done with the following line of code:
Caption := TimeToStr(Time); }
end;