public static String formatTime(int hour,int minute){
  String s="";
  String t=Integer.toString(hour);
  if (t.length() == 2) {
    s=t + ":";
  }
 else   if (t.length() == 1) {
    s="0" + t + ":";
  }
  t=Integer.toString(minute);
  if (t.length() == 2) {
    s=s + t;
  }
 else   if (t.length() == 1) {
    s=s + "0" + t;
  }
  if (s.length() != 5) {
    s="00:00";
  }
  return s;
}

public static String formatTime ( int hour , int minute ) { String s = "" ; String t = Integer . toString ( hour ) ; if ( t . length ( ) == 2 ) { s = t + ":" ; } else if ( t . length ( ) == 1 ) { s = "0" + t + ":" ; } t = Integer . toString ( minute ) ; if ( t . length ( ) == 2 ) { s = s + t ; } else if ( t . length ( ) == 1 ) { s = s + "0" + t ; } if ( s . length ( ) != 5 ) { s = "00:00" ; } return s ; }
formats time to hh : mm given integer hour and minute
