there seems a simple mistake by me, I wrote this code to get a formatted date but if date dosn\'t have correct string to convert, class should catch the error but it doesn\'t wo