A flag in case validation was successful for more than 1 formats.
2) you can prevent the Parse Exception using the often overlooked other parse method, that takes a Parse Position.
This purpose of this post is to provide step-by-step guidance to develop a utility that will have the following functionality: 1) This utility will help to validate a date format entered by the user.
Thus, we need to validate whether the user entered data is in a valid format or not and then we need to convert that into a format that can be easily inserted into the database. = null) [/code] The Parse Position is a simple class used by Format and its subclasses to keep track of the current position during parsing.
Need to import the following packages first: import The parse Object method in the various Format classes requires a Parse Position object as an argument.
I still don't like one thing about this solution: if the String has a valid date followed by some other garbage (e.g.