2015. 2. 12. 15:36ㆍC++
http://www.boost.org/doc/libs/1_57_0/doc/html/date_time/gregorian.html#date_time.gregorian.date_class
boost::gregorian::date d(2015, 1, 30);
LOG_DEBUG<<boost::gregorian::to_iso_extended_string(d); //2015-01-30
// 가감연산
boost::gregorian::days dd(1); //1일
boost::gregorian::years dy(1); //1년
boost::gregorian::months dm(1); //한달
boost::gregorian::date d2 = d+dd+dy+dm; // 2015-01-30 + 1년1달1일
LOG_DEBUG<<boost::gregorian::to_iso_extended_string(d2); //2016-02-29
// 날짜차이
boost::gregorian::date_period dp1(d,d2);
LOG_DEBUG<<"날짜차이="<<dp1.length(); //395
// 변환
time_t tNow = time(NULL);
tm* tm_now = localtime(&tNow);
boost::gregorian::date d3 = boost::gregorian::date_from_tm(*tm_now);
tm d_tm = boost::gregorian::to_tm(d3);
LOG_DEBUG<<boost::gregorian::to_iso_extended_string(d3);