Example: Parsing date / time from string then I want to break down the components of the date/time.. It seems I get all but I am stuck on the fractional seconds. Code follows
std::wistringstream in{ L"2016-12-11 15:43:22.0999919" };
date::sys_time<std::chrono::microseconds> tp;
in >> date::parse(L"%F %T", tp);
assert(!in.fail());
assert(!in.bad());
date::sys_days dp = date::floor<date::days>(tp);
date::year_month_day the_date = date::year_month_day{ dp };
date::time_of_day<std::chrono::microseconds> the_time = date::make_time(tp - dp);
std::cout << the_date << ' ' << the_time << std::endl;
std::cout << "Year: " << the_date.year() << std::endl;
std::cout << "Month: " << (unsigned)the_date.month() << std::endl;
std::cout << "Date: " << the_date.day() << std::endl;
std::cout << "Hour: " << the_time.hours().count() << std::endl;
std::cout << "Minutes: " << the_time.minutes().count() << std::endl;
std::cout << "Seconds: " << the_time.seconds().count() << std::endl;
// the following is incorrect
std::cout << "Micro Seconds: " << the_time.microseconds().count() << std::endl;
error C2039: 'microseconds': is not a member of 'date::time_of_day'