I just use what was in yearFromString method.   Whatever  if the year string is 4 or 8 numbers, the year is always at the begining so we takes the 4 first numbers.