In my case just display current time in textview but it not working properly.
Calendar calendar = Calendar.getInstance();
Date today = calendar.getTime();
dateFormatter = new SimpleDateFormat("dd-MM-yyyy");
String todayAsString = dateFormatter.format(today);
datePickUp.setText(todayAsString);
SimpleDateFormat dF = new SimpleDateFormat("hh:mm a");
String currentTime = dF.format(today);
timePick.setText(currentTime);
In today
the value is Wed Jun 21 12:22:32 GMT+05:30 2017
but in currenTime
value is as 06:52 AM.