S sonie Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-17 #2 time*24得到的以小时为单位的时间,整数部分自然就是小时了<br>小数部分*60的整数部分就是分<br>....<br><br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> hour,min,sec:integer;<br> ti:double;<br>begin<br> ti:=time;<br> hour:=trunc(ti*24);<br> min:=trunc((ti*24-hour)*60);<br> sec:=trunc(((ti*24-hour)*60-min)*60);<br> showMessage(inttostr(hour)+':'+inttostr(min)+':'+inttostr(sec));<br>end;<br>
time*24得到的以小时为单位的时间,整数部分自然就是小时了<br>小数部分*60的整数部分就是分<br>....<br><br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> hour,min,sec:integer;<br> ti:double;<br>begin<br> ti:=time;<br> hour:=trunc(ti*24);<br> min:=trunc((ti*24-hour)*60);<br> sec:=trunc(((ti*24-hour)*60-min)*60);<br> showMessage(inttostr(hour)+':'+inttostr(min)+':'+inttostr(sec));<br>end;<br>
B BornKilled Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-17 #4 <br>用DecodeDateTime procedure()<br>uses<br>DateUtils<br><br>procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word);
<br>用DecodeDateTime procedure()<br>uses<br>DateUtils<br><br>procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word);