year:=copy(DateTimePicker,1,4);
month:=copy(DateTimePicker,6,2);

解决方案 »

  1.   

    DecodeDate(DateTimePicker.date, Year, Month, Day);
      

  2.   

    decodedate(DateTimePicker1.DateTime,y,m,d);
      

  3.   

      DateStr:= Copy(Datetostr(TimePicker.date), 9, 2);
      MonthStr:=Copy(Datetostr(TimePicker.date), 6, 2);
      YearStr:=Copy(Datetostr(TimePicker.date), 3, 2);
      

  4.   

    var
      year,month,day:word;
    begin
        DecodeDate(DateTimePicker.date, Year,Month,Day);
        Label1.Caption := inttostr(year);
        Label2.Caption := inttostr(month);
        Label3.Caption := inttostr(day);
    end
      

  5.   

    ┬┴┬┌─ ●─┬─  │─┼─┐ ●├─┤○
    ┴┬┴├┬ ┌─┼─ │◎ │ │ ○└┬┘●
    ─┼─││ │ │  ││─┴─┴ ──┼──
    ●│○││ ┴─┼─  │○  ● / │ \
     var
      year,month,day:word;
    begin
        DecodeDate(DateTimePicker.date, Year,Month,Day);
        Label1.Caption := inttostr(year);
        Label2.Caption := inttostr(month);
        Label3.Caption := inttostr(day);
    end