Best Way to parse a string to a unexpectable Date Format
posted 10 years ago
I have a string variable that contains the date with the format like "20060216", and I want to use Java program to parse it to "2006-02-16". How can I do that in a quick manner ? I tried to do the following, but it gives me year of 1970. I will appreciate if you can explain the reason to me.