怎么样获取目前的日期

解决方案 »

  1.   

    date()显示就是edit.text:=datetostr(date());应该是这样的吧
      

  2.   

    datetostr(now);测试过:
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      showmessage(datetostr(now));
    end;
      

  3.   

    label1.Caption:=formatdatetime('yyyy''-''mm''-''dd '+ Timetostr(time ),Now);
    label2.Caption:=formatdatetime('dddd',Now);
      哈哈,愿意用那个就用那个!!!
      

  4.   

    now
    date
    monthof
    dayof
    yearof
    使用的时候在unit头添加日期库 DateUtils
      

  5.   

    edit1.text:=datetostr(date());这样得到的结果是当前的年月日;
    edit2.text:=FormatDateTime('yyyy''年''m''月''d''日''dddd'+'hh:mm:ss AM/PM',Now);这样得到的是当前的年月日和时间(时、分、秒)
    如果你再加上一个TTimer,并且将Interval值设为1000,则可以实现动态的时钟显示。
      

  6.   

    1.得到返回值是日期型的用 Date 函数。
    2.分别得到年月日。
      GetLocalTime(SystemTime);
      with SystemTime do 
      begin
        ShowMessage('年是:'+IntToStr(wYear)); 
        ShowMessage('月是:'+IntToStr(wMonth));
        ShowMessage('日是:'+IntToStr(wDay));
      end;
      

  7.   

    先用now方法取得当前时间,然后用DateToStr()或者DateTimeToStr()转换一下,然后就能用了!
      

  8.   

    now,返回当前的日期与时间;
    date: 返回当前的日期;
    time: 返回当前的时间;