编译器总是不认:FormatDataTime 那位高手帮帮我........我在报表里要读取.TDataTimePicker 里面的时间在报表里显示出来,然后打印出今天登记日期如:    2003年11月6号
qrlabel1.Caption :=FormatDateTime('YYYY'+'''年'''+'MM'+'''月'''+'DD'+'''日''',NOW)
formatdatetime('yyyy年m月d日',DataTimePRegister.Datetime)
以上总是不行,很奇怪了..D 7 重装了...编译器总是提示:Undeclared identifier 'FormatDataTime' SysUtils  里面的源代码我看过...不应该有的问题啊..........急......立马给分

解决方案 »

  1.   

    首先caption是字符型,你可以将时间转换成字符
    qrlabel1.Caption :=datetostr(FormatDateTime('YYYY'+'''年'''+'MM'+'''月'''+'DD'+'''日''',NOW))
      

  2.   

    var
      Year, Month, Day: Word;
    begin
    DecodeDate(strtodate(FormatDateTime('yyyy-mm-dd',now))Year, Month, Day);
      qrlabel1.Caption :=inttostr(year)+'年'+inttostr(month)+'月'+inttostr(day)+'日';
    end;
    需要使用SysUtils这个单元
    uses 
    SysUtils
      

  3.   

    form1.Caption :=FormatDateTime('YYYY''年''MM''月''DD''日''',NOW)