delphi中年,月,日,时,分,秒的函数是什么?paradox表

解决方案 »

  1.   

    date只可以取年,月,日,取年,月,日,时,分,秒的函数是什么呢?
      

  2.   

    procedure Tform1.button1click(sender:object);
    begin
    label1.caption:=FormatDateTime('yy_MM_dd_hh_mm_ss',Now);
    end;
      

  3.   

    procedure Tform1.button1click(sender:object);
    begin
    label1.caption:=FormatDateTime('yyyy年MM月dd日 hh:mm',Now);
    end;
      

  4.   

    Now()取得当前时间(包括日期),为双精度型浮点数。
    DateTimeToStr(Now):string,转化为易读的字符串格式:
    "yyyy-mm-dd hh:mm:ss"  (win98可能年份只有两位)。ss就是秒。
      

  5.   

    getsystemtime(t);
    t.year
    t.month
    t.day
    t.hour
    t.minitue
    t.second
    都有!
      

  6.   

    procedure TForm1.Button1Click(Sender: TObject);var
      Present: TDateTime;
      Year, Month, Day, Hour, Min, Sec, MSec: Word;
     begin
      Present:= Now;
      DecodeDate(Present, Year, Month, Day);
      Label1.Caption := 'Today is Day ' + IntToStr(Day) + ' of Month '
        + IntToStr(Month) + ' of Year ' + IntToStr(Year);
      DecodeTime(Present, Hour, Min, Sec, MSec);
      Label2.Caption := 'The time is Minute ' + IntToStr(Min) + ' of Hour '
        + IntToStr(Hour);
    end;