In my programm there is a very strange problem. Here you can see String birthday
and Log
to check it:
birthday = String.valueOf(birthYear) + "-" + String.valueOf(birthMonth) + "-" + String.valueOf(birthDay);
Log.i(TAG, "Birthday: " + birthday)
Then I put it to SimpleDateFormat and check it with the Log
:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd");
Date birthDate = sdf.parse(birthday);
Log.i(TAG, "Birth date : " + birthDate);
And then in Logcat
I have:
I/App﹕ Birthday: 1999-10-15
I/App﹕ Birth date: Fri Jan 15 00:10:00 GMT+04:00 1999
So as you see in the date it is Jan
, but in the String it is 10
so date should look like:
Fri Nov 15 00:10:00 GMT+04:00 1999
Where is my mistake?
P.S I think my question is somehow connected with Getting wrong data when using SimpleDateFormat.parse()