Update:
Really?!!! Duplicate??? My format is correct (yyyy/MM/dd HH:mm:ss)
but return time is incorrect. How this is similar to another question????
I'm trying to create java Date
but it's always return wrong value. This is my code:
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:MM:SS");
Date GreDate = dateFormat.parse("2014/03/22 00:00:00");
And GreDate
return Sun Dec 22 00:00:00 GMT+03:30 2013
as value.
Please don't suggest to use external library for date type.
Update:
I changed my pattern to this:
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Now GreDate
returns Sat Mar 22 01:00:00 GMT+04:30 2014
. Year is correct but time still not 00:00:00
.