What is the best way to convert date in String format "YYYY-MM" to Date object in Java apart from String parsing.
What I tried is below.
String expirationDateArr[] = dateStr.split("-");
Then extract month and year to create the Date object.
What is the best way to convert date in String format "YYYY-MM" to Date object in Java apart from String parsing.
What I tried is below.
String expirationDateArr[] = dateStr.split("-");
Then extract month and year to create the Date object.