使用Format函数时,如果参数时TDateTime类型的,那个%后面接什么啊?我用%f,%g都不对?
在线等待!

解决方案 »

  1.   

    就用TDateTime::FormatString好了
    TDateTime now = TDateTime::CurrentDateTime();
    ShowMessage(now.FormatString("yyyy-mm-dd hh:nn:ss"));
      

  2.   

    FormatDateTime("yyyy-mm-dd hh:nn:ss",Time);
      

  3.   

    用FormatDateTime函数FormatDateTime('mm,dd, yyyy, hh:mm:ss', Now )
    格式化形式看帮助主题:Date-Time format strings
      

  4.   

    你需要的是FormarDateTime,详见Help
    另外TDateTime的本质是Double的浮点数
      

  5.   

    http://community.csdn.net/Expert/topic/3088/3088634.xml?temp=.2877924
      

  6.   

    function Format ( Const Formatting : string; Const Data : array of const ) : string; 
    function Format ( Const Formatting : string; Const Data : array of const; FormatSettings : TFormatSettings ) : string; 
      

  7.   

    用%s,但是需要将date转化为string,用这个datetimetostr,例子
    deststr:=format('Today is %s',[datetimetostr(now())]);
    希望能对你有所帮助.