public static String timeToString(String time){
  String theTime=null;
  if (Pattern.matches("[012][0-9]:[0-5][0-9]",time)) {
    int hour=Integer.parseInt(time.substring(0,2));
    int min=Integer.parseInt(time.substring(3));
    theTime=timeToString(hour,min);
  }
  return theTime;
}

public static String timeToString ( String time ) { String theTime = null ; if ( Pattern . matches ( "[012][0-9]:[0-5][0-9]" , time ) ) { int hour = Integer . parseInt ( time . substring ( 0 , 2 ) ) ; int min = Integer . parseInt ( time . substring ( 3 ) ) ; theTime = timeToString ( hour , min ) ; } return theTime ; }
returns a string that corresponds to the given time .
