首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

如何从DateTimePicker1->DateTime分离年月日

2012-02-23 
怎么从DateTimePicker1-DateTime分离年月日怎样从DateTimePicker1-DateTime分离出年月日?[解决办法]用De

怎么从DateTimePicker1->DateTime分离年月日
怎样从DateTimePicker1->DateTime分离出年月日?

[解决办法]
用DecodeDate方法
http://www.delphitop.com/html/shijian/308.html
[解决办法]

C/C++ code
      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);

热点排行