是用这个过程吗
decodedate(date,year,month,day);
可是year,month,day都是word型不知道怎么转化~~~
help~~~

解决方案 »

  1.   

    有现在的函数:
    var
      Year, Month, Day: Word;
    begin
      DecodeDate(CurDate, Year, Month, Day);
    end;
      

  2.   

    CurDate 是你要分解的日期。
      

  3.   

    var y,m,d :Word;
    ...
    decodedate(y,m,d,Date):
      

  4.   

    var y,m,d :Word;
    ...
    decodedate(Date,y,m,d);
      

  5.   

    可能要使用 Sysutils 单元!
    你试试!
      

  6.   

    var
      y,m,d word;
      yy,mm,dd string
    decodedate(date,y,m,d)
    yy:=string(y)
    ....
    ....
    showmessage(yy)
      

  7.   

    decodedate(date,y,m,d)
    showmessage(inttostr(y));
      

  8.   

    这样啊:FormatDateTime('yyyy年MM月dd日');
      

  9.   

    var
      Year, Month, Day: Word;
    begin
      DecodeDate(CurDate, Year, Month, Day);
    end;
      DecodeDate 和EncodeDate相对应,一个是分开,一个是合并日期。
      

  10.   


    decodedate(date,y,m,d)
    yy:=string(y)
    ....
    ....
    showmessage(yy)y是word型,yy:=string(y)错误编译不过~~~我试过了怎么弄告诉我~
      

  11.   

    Function GetDateID(i:integer;date:string):String;
    var
      Year, Month, Day:Word;
      StrYear,StrMonth,StrDay:String;
    begin
      DecodeDate(Now, Year, Month, Day);
      if Year<10 then   StrYear:='0'+IntToStr(Year)
      else    StrYear:=IntToStr(Year);  if Month<10 then  StrMonth:='0'+IntToStr(Month)
      else    StrMonth:=IntToStr(Month);  if Day<10 then    StrDay:='0'+IntToStr(Day)
      else              StrDay:=IntToStr(Day);
       
    Result:=StrYear+StrMonth+StrDay;
    end;
    这里的now是返回当前时间 可以用你自己的date试试