I am developing an Android application, which has two EditText boxes and a button. In the first EditText box, I set the value 13/08/2014. On pressing the button, the value of the first EditText is converted into Date and then inserted into the second EditText.
I use the following code.
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
String ss=todaysdate.getText().toString();
Date d1 = df.parse(todaysdate.getText().toString());
What happens is, on pressing the button, value of ss and d1 becomes
ss = 13/08/2014
d1 = Thu Jan 08 00:00:00 IST 2015
See the change, it becomes January 8, 2015
Why is this, and what is the error?