怎么从DateTimePicker1->DateTime分离年月日
怎样从DateTimePicker1->DateTime分离出年月日?
[解决办法]
用DecodeDate方法
http://www.delphitop.com/html/shijian/308.html
[解决办法]
unsigned short year,month,day; DateTimePicker1->Date.DecodeDate(&year,&month,&day); ShowMessage(year); ShowMessage(month); ShowMessage(day);
[解决办法]
1楼的提示已足够,就用DecodeDate方法。
[解决办法]
Year=FormatDateTime("YYYY",DateTimePicker1->DateTime);
Month=FormatDateTime("MM",DateTimePicker1->DateTime);
Day=FormatDateTime("DD",DateTimePicker1->DateTime);