I have two time values. one for the previous login time and one for the current login time. I have to increase previous time login by one hour. I have used the date format
Calendar calendar = Calendar.getInstance();
calendar.setTime(previous_time);
calendar.add(Calendar.HOUR, 1);
previous_time = calendar.getTime();
// do your comparison
previous_time.setTime(previous_time.getTime() + 60 * 60 * 1000);
or
Date session_expiry = new Date(previous_time.getTime() + 60 * 60 * 1000);
http://download.oracle.com/javase/6/docs/api/java/util/Date.html#getTime%28%29
Please try this code.
SimpleDateFormat sdf = new SimpleDateFormat("h:mm a");
Date date = Utils.getBookingDate(mBooking.ToTime);
Calendar calendarAdd = Calendar.getInstance();
calendarAdd.setTime(date);
calendarAdd.add(Calendar.HOUR, 1);
toTime = sdf.format(calendarAdd.getTime());
tv_Totime.setText(toTime);
when current time string formate within add 1 hours