Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Function template parse_date

boost::date_time::parse_date — Generic function to parse a delimited date (eg: 2002-02-10)


// In header: <boost/date_time/date_parsing.hpp>

template<typename date_type> 
  date_type parse_date(const std::string & s, int order_spec = ymd_order_iso);


Accepted formats are: "2003-02-10" or " 2003-Feb-10" or "2003-Feburary-10" The order in which the Month, Day, & Year appear in the argument string can be accomodated by passing in the appropriate ymd_order_spec