var a:SystemTime;getSystemtime(a); if datetimepicker1.date=a then showmessage('ok');
你把datetimepicker1的time属性你的值删掉就可以了
不行就都加个datetostr转换成string再比,试试
if StrToDateTime(formatDateTime('yyyy/mm/dd',DateTimePicker1.Datetime))= StrToDateTime(formatDateTime('yyyy/mm/dd',now)) then showmessage('ok') else showmessage('no');
shortdateformat:='yyyymmdd'; longdateformat:='yyyymmdd';if datetimepicker1.date=date then showmessage('ok');
a:SystemTime;getSystemtime(a);
if datetimepicker1.date=a then
showmessage('ok');
StrToDateTime(formatDateTime('yyyy/mm/dd',now)) then
showmessage('ok')
else
showmessage('no');
longdateformat:='yyyymmdd';if datetimepicker1.date=date then
showmessage('ok');
StrToDateTime(formatDateTime('yyyy/mm/dd',DateTimePicker1.Datetime))= StrToDateTime(formatDateTime('yyyy/mm/dd',now))
date1,date2 : TDateTime ;
begin
date1 := DateTimePicker1.Date ;
date2 := TDateTime(now) ;
if (date1=date2) then
showmessage('ok');
先将时间格式化一下