本人菜鸟。对很多函数不熟,希望大家帮忙,分数不多,但已经是我的全部的了。谢谢

解决方案 »

  1.   

    uses DateUtils
    yearof
    mounthof
      

  2.   

    或者
    showmessage(formatdatetime('yyyy',now))
      

  3.   

    procedure DecodeDate(Date: TDateTime; var Year, Month, Day: Word);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;
      

  4.   

    DecodeDate:分解时间
    EncodeDate:组合时间