Date parsing problem inside java
930431Apr 18 2012 — edited Apr 19 2012Hi,
I'm passing a date string in format yyyy-MM-dd and trying to convert into a date value using below code by parsing the string. But, interestingly the output that i'm getting from dateVal is coming as - Tue Apr 17 00:00:00 GMT 2012 instead of 2012-04-17
Not able to understand why so.
String s1 = "2012-04-17";
SimpleDateFormat outFmt = new SimpleDateFormat("yyyy-MM-dd");
Date dateVal = outFmt.parse(s1);
Please help.
Regards,
prodyut