如(TDateTime)2004-5-9
我想把9这个数字取出来给string1

解决方案 »

  1.   

    Var
      y,m,d:word
      present:TDateTime;
    begin
      decodedate(present,y,m,d)
      showmessage('日:'+IntToStr(d));
    end;
    也可以用FormatDateTime()
      

  2.   

    var
    i:integer;
    begin
     i:=StrToint(FormatDateTime('dd',date));
     ShowMessage(InttoStr(i));
    end;
      

  3.   

    Unit DateUtils;function DayOf(const AValue: TDateTime): Word;
      

  4.   

    
    TTT.java ***** TST.CLASS
    SourceFile
    Tst.java ********** TTT.class
    
    TTT
    java/lang/Object
    ***** TST.CLASS
    
    Tst
    java/lang/Object
    *****
      

  5.   

    decodedate(present,y,m,d)
    不行吗?
      

  6.   

    一句话搞定
    showmessage(formatdatetime('dd',now))
      

  7.   

    1:formatdatetime('dd',now);
    2:dayof(now);
    3.decodedate(present,y,m,d)
    任选一个都可以。
      

  8.   

    1:formatdatetime('dd',now);
    2:dayof(now);
    3.decodedate(present,y,m,d)
    任选一个都可以。
      

  9.   

    Var
      y,m,d:word
      present:TDateTime;
    begin
      decodedate(present,y,m,d)
      showmessage('日:'+IntToStr(d));
    end;