I have a text file full of data that I am putting into a Red Black tree, using the date as the key and the rest of the data from that line as the value. The problem is that some of the dates have this format:
"yyyy-MM-dd"
while some of the other dates have this format:
"M/dd/yyyy"
I need a way to compare these two dates, since I am using them as the key in my Red Black tree, so I need a common format. I'm not sure which would be easier for comparison, but I just know that they need to be in the same format. I've read a bit about SimpleDateFormat, but since I'm thinking of reading through the file, having some sort of if statement to determine if the date is in the wrong format, and then formatting it to the one I want, I'm just not sure how to do that with SimpleDateFormat since I've never used it before. Any help would be appreciated!