boost类库年、月、日获取

char startDatetime[20] = "20130620143525";
  date myUndefineDate = from_undelimited_string(startDatetime);
  cout << to_iso_string(myUndefineDate) << endl;
  int nYear = myUndefineDate.year();
  int nMonth = myUndefineDate.month();
  int nDay = myUndefineDate.day();


  cout << "年" << nYear << endl;
  cout << "月" << nMonth <<endl;
  cout << "日" << nDay << endl;

posted @ 2013-06-20 20:38  Predator  阅读(316)  评论(0编辑  收藏  举报