datetime 计算问题(12分)

P

philips

Unregistered / Unconfirmed
GUEST, unregistred user!
在 bcb4中,计算两日期之间的天数用:
iTS = datetime1- datetime2;
对于字符串类型日期用:
iTS = StrToDate(sDate1)-StrToDate(sDate1);
能得到正确结果,可在Delphi5中,却不正确,大家是怎样做的?
 
>> iTS = StrToDate(sDate1)-StrToDate(sDate1);
︿︿︿︿︿︿︿   ︿︿︿︿︿︿︿︿ 
My God!!! "StrToDate(sDate1)" is same as "StrToDate(sDate1)"
 
the result
iTS is 0.
 
用下面的:
procedure DecodeDate(Date: TDateTime;
var Year,Month, Day: Word);
procedure DecodeTime(Time: TDateTime;
var Hour, Min, Sec, MSec: Word);


 
接受答案了.
 

Similar threads

顶部