Delphi - TDateTimePicker使用注意问题

TDateTimePicker使用时候,如果想获取到修改后的值,必须注Kind和time属性必须对应!

1,时间设置:

  treatmentTime1DTPicker.Kind := dtkTime;
treatmentTime1DTPicker.Format := 'HH:mm';
treatmentTime1DTPicker.Time := now;

2,日期设置:

  treatmentTime2DTPicker.Kind := dtkDate;
treatmentTime2DTPicker.Format := 'yyyy-mm-dd';
treatmentTime2DTPicker.Date := now;  

得到上面两个控件的日期和时间 

FormatDateTime('yyyy-mm-dd hh:mm:ss', Trunc(treatmentTime2DTPicker.Date) +Frac(treatmentTime1DTPicker.time));

  

参考:

https://www.cnblogs.com/hellochenchen/p/5438497.html

https://ifso.iteye.com/blog/1752420

https://www.cnblogs.com/findumars/p/3821293.html

上一篇:CSS 禁止浏览器滚动条的方法(转)


下一篇:Android-----LocalService