Would not be better to do the try in here with the `%y` and `%Y` than into a new function and provide a proper error message?