善
善凉的狼
Unregistered / Unconfirmed
GUEST, unregistred user!
我编了一个程序如下tempSec := sum div 60;
sec := sum mod 60;
tempMinu := tempSec div 60;
minu := tempSec mod 60;
tempHour := tempMinu div 24;
Hour := tempMinu mod 24;
baseDate := StrToDateTime('1980-01-01');
nowDate := tempHour + Trunc(baseDate);//转换出年月日
nowTime := StrToDateTime(IntToStr(hour) + ' : ' + IntToStr(minu) + ' : '+ IntToStr(sec));
showMessage(DateTimeToStr(nowTime));
Result := DateTimeToStr(nowDate)+ ' ' + DateTimeToStr(nowTime);
showMessage(Result);
该程序是要把以秒为单位的偏移量sum转变回日期,但运行结果nowTime却等与1899-12-31 19:20:23 我的本意是要nowTime显示时间不是日期呀,怎么回事,高手指点
sec := sum mod 60;
tempMinu := tempSec div 60;
minu := tempSec mod 60;
tempHour := tempMinu div 24;
Hour := tempMinu mod 24;
baseDate := StrToDateTime('1980-01-01');
nowDate := tempHour + Trunc(baseDate);//转换出年月日
nowTime := StrToDateTime(IntToStr(hour) + ' : ' + IntToStr(minu) + ' : '+ IntToStr(sec));
showMessage(DateTimeToStr(nowTime));
Result := DateTimeToStr(nowDate)+ ' ' + DateTimeToStr(nowTime);
showMessage(Result);
该程序是要把以秒为单位的偏移量sum转变回日期,但运行结果nowTime却等与1899-12-31 19:20:23 我的本意是要nowTime显示时间不是日期呀,怎么回事,高手指点