You have to use y
for years. Y
is used for week year :
DateFormat formatter = new SimpleDateFormat("yyyyddMM_HHmmss");
Output:
Sat May 07 06:02:29 CEST 2011
It should be June 7 instead of Jan 3
The 5th month in the year is may, not june.