I have generate today date and separate day and month from the today date but its give ParseException.
Example : I have retrieve date 6 Aug 2018 11:14:02 am from separate day 6 and separate month 8.
try {
String currentDateTimeString = DateFormat.getDateTimeInstance().format(new Date());
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy", Locale.US);
Date date = format.parse(currentDateTimeString);
SimpleDateFormat dayFormat = new SimpleDateFormat("dd");
day = dayFormat.format(date);
tvday.setText(day);
SimpleDateFormat monthFormat = new SimpleDateFormat("MM");
month = monthFormat.format(date);
tvMonth.setText(month);
} catch (ParseException e) {
e.printStackTrace();
}