When trying to convert a string to Date, I keep encountering an error message stating Invalid Date
.
The input will consist of a String with one of the following data formats:
YYYY
- year onlyMM/YYYY
- month & yearDD/MM/YYYY
- full date
While the expected output should be a Date
, I am struggling with converting the MM/YYYY
format.
Any suggestions on how to handle this particular scenario would be greatly appreciated. Thank you.