If I understood your question is transforms Dates and Times into and vice versa Strings, an easy way to do is using SimpleDateFormat, passing a string with time format. The reverse is also possible.
Example
DateFormat formatter = new SimpleDateFormat("HH:mm:ss"); //Hora, minuto, segundo.
formatter.format(new Date()); // Deverá mostrar hora atual em string
DateFormat parser = new SimpleDateFormat("DD/mm/YYYY HH:mm:ss");
Date date = parser.parse("21/02/1987 02:02:00"); // Deverá transformar a string em Date se a data estiver no padrão
How to convert date into string and date new
SimpleDateFormat Class Documentation
DateFormat Class Documentation