I am trying to get current Date in the format. "yyyy/MM/dd". I have written following code to achieve this.
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd", Locale.US);
Calendar cal = Calendar.getInstance();
String dateStr = dateFormat.format(cal.getTime());
currentDate= dateFormat.parse(dateStr);
The value of current Date after process is this
Mon Jun 20 00:00:00 GMT+05:00 2016
,
The value of dateStr
after formatting is 2016/06/20
Kindly guide me what i am doing wrong here.