var Present: TDateTime; Year, Month, Day, Hour, Min, Sec, MSec:Word; begin Present:= Now; DecodeDate(Present, Year, Month, Day); DecodeTime(Present, Hour, Min, Sec, MSec); Showmessage(DateToStr(Present)+' '+TimeToStr(Present,'hh'));//顯示年月日時分秒 Showmessage(formatdatetime('hh:mm',time));//顯示時分 cbb_qs_n.Text := inttostr(Year);//顯示年 cbb_qs_y.Text := inttostr(Month);//顯示月 cbb_qs_r.Text := inttostr(Day);//顯示日 cbb_qs_s.Text := IntToStr(Hour);//顯示時 cbb_qs_f.Text := IntToStr(Min);//顯示分 end;