Plase have a look at the below code
Calendar date = Calendar.getInstance();
initialClientLetterDate.setText(date.get(Calendar.YEAR)+"/"+date.get(Calendar.MONTH)+"/"+date.get(Calendar.DAY_OF_WEEK));
This generates the invalid "month" and "date". The output is 2014/09/06
. Why is this? I just wanted to get current year, date and month.
You are using DAY_OF_WEEK
which is 6 for FRIDAY
and MONTH
starts from 0 not 1 so you have to add 1 in it.You can use DAY_OF_MONTH
instead of DAY_OF_WEEK
.