This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
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.