I am parsing multiple String objects containing date in format of mm/dd/yyyy into Date objects using SimpleDateFormatter
Problem I am facing is that, some String contain complete date means it is mm/dd/yyyy while some Strings do not contain year and comes in this format mm/dd
I am using this format to parse dates MM/dd/yyyy but everytime I get a String with only month and day, I get parsing exception.
I want to know, is there any way by which if a year field is missing then I can use something like 0000 or I need to tackle it into exception body only?
as far as i know you can create an instance of SimpleDateFormat that does not “need” an year.
So just use an try-catch-Block