def _CopyDateFromString(self, date_string):
date_string_length = len(date_string)<EOL>if date_string_length < <NUM_LIT:10>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if date_string[<NUM_LIT:4>] != '<STR_LIT:->' or date_string[<NUM_LIT:7>] != '<STR_LIT:->':<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>year = int(date_string[<NUM_LIT:0>:<NUM_LIT:4>], <NUM_LIT:10>)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>month = int(date_string[<NUM_LIT:5>:<NUM_LIT:7>], <NUM_LIT:10>)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>day_of_month = int(date_string[<NUM_LIT:8>:<NUM_LIT:10>], <NUM_LIT:10>)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>days_per_month = self._GetDaysPerMonth(year, month)<EOL>if day_of_month < <NUM_LIT:1> or day_of_month > days_per_month:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>return year, month, day_of_month<EOL>
Copies a date from a string.

        Args:
          date_string (str): date value formatted as: YYYY-MM-DD

        Returns:
          tuple[int, int, int]: year, month, day of month.

        Raises:
          ValueError: if the date string is invalid or not supported.