同上

解决方案 »

  1.   

    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;
      

  2.   

    用formatdatetime:example:{Get year} showmessage(formatdatetime('yyyy',date));{Get day}
     showmessage(formatdatetime('dd',date));
      

  3.   

    GetLocalTime,能精确到千分之一秒
      

  4.   

    请关注http://expert.csdn.net/Expert/topic/1380/1380380.xml?temp=.1580774中我的回复,对我的时间函数提提意见,我很菜的