关于TDateTimePicker的问题? 1.我想取出DateTimePicker中选取的日期,将日期赋值到一个Label中,怎么取值啊?2.假设我有两个DateTimePicker,分别选取了两个时间,我想算出这两个时间的相差天数,怎么算啊?如果能算的出,这个天数是什么型的啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1 lable := DateToStr(DateTimePicker1.Date);2 tianshu := DateTimePicker1.Date - DateTimePicker2.Date; integer型 DateTimePicker.Date //取日期值DateTimePicker.Time //取时间值DateTimePicker.DateTime //取日期时间值.Int(DateTimePicker1.Date) - Int(DateTimePicker2.Date) //求两日期的相差在数. 1。Label1.Text = DateTimePicker1.Text2。Msgbox(DateDiff(DateInterval.Day, DateTimePicker1.Value, DateTimePicker2.Value)) 不好意思,刚才发错了。这是 VB.Net 的写法。该扁! var Year, Month, Day: Word; begin Present:= Now; DecodeDate(DateTimePicker1.date, Year, Month, Day); Label1.Caption := 'Today is Day ' + IntToStr(Day) + ' of Month ' + IntToStr(Month) + ' of Year ' + IntToStr(Year); 我用:DateTimePicker1.Date - DateTimePicker2.Date;好像不能直接相减的,用Int(DateTimePicker1.Date) - Int(DateTimePicker2.Date)也试过,可是都出错!为什么?? 循环内创建对象怎么避免? 小弟有一个问题,请高手给想想办法,我现在想下载一个网站,包括网页及图片.如何实现了? ListView Column的动态创建和删除 如何去掉标准窗口右上角的三个按钮?在线等!! 俺向大侠们请教 怎样调用系统的取消事件,即CTRL+Z 寻技术框架开发同好· Paradox数据库执行post,数据并未写入磁盘? 请问如何改变TListView的列头(vsReport时)的背景颜色? 求助:如何自己开发一个pdf文档阅读器? 招聘兼职:熟悉DELPHI+SQL程序员,要求有实际经验 急!!与数据库联系的时间控件的怪问题 离开 论坛 散分【十】
2 tianshu := DateTimePicker1.Date - DateTimePicker2.Date; integer型
DateTimePicker.Time //取时间值
DateTimePicker.DateTime //取日期时间值.Int(DateTimePicker1.Date) - Int(DateTimePicker2.Date) //求两日期的相差在数.
2。Msgbox(DateDiff(DateInterval.Day, DateTimePicker1.Value, DateTimePicker2.Value))
Year, Month, Day: Word;
begin
Present:= Now;
DecodeDate(DateTimePicker1.date, Year, Month, Day);
Label1.Caption := 'Today is Day ' + IntToStr(Day) + ' of Month '
+ IntToStr(Month) + ' of Year ' + IntToStr(Year);
DateTimePicker1.Date - DateTimePicker2.Date;
好像不能直接相减的,用
Int(DateTimePicker1.Date) - Int(DateTimePicker2.Date)
也试过,可是都出错!
为什么??