you could use here std::sscanf:
std::sscanf( date_time_, "%4d%2d%2d", &year, &month, &day );