#include #include #include #include using namespace std; using namespace boost::posix_time; ptime ptime_from_rss_pub_date(const string& pub_date) { time_input_facet* timefacet = new time_input_facet("%a, %d %b %Y %H:%M:%S"); istringstream ss(pub_date); ss.imbue(std::locale(ss.getloc(), timefacet)); local_date_time t; ss >> t; return t; } int main() { ptime t = ptime_from_rss_pub_date("Sat, 20 Sep 2008 11:25:00 +0100"); cerr << "Parsed time: " << to_simple_string(t) << endl; }