如题,如何只能显示时间:时和分呢?

解决方案 »

  1.   

    1 sql中没有time类型,只有datatime,存储和delphi一样,是float整数表示日期,距离1899-12-30 的天数,小数表示时间
    2 你可以用ftTime类型的字段而不用ftDataTime类型来达到
    3 你可以在前台使用formatdatetime达到
    formatdatetime('hh:mm',field.value);
      

  2.   

    要不行的话,就用char类型字段就是了,通过datatimepicker转化
      

  3.   

    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;