fork download
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.text.*;
import java.time.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	
	public static LocalTime formataData(String data) throws Exception {
    if (data == null || data.equals(""))
        return null;
    LocalTime lt;
   
        lt = LocalTime.parse(data);
   
    return lt;
}
	
	public static void main (String[] args) throws java.lang.Exception
	{
		String hora = "13:32:00";
		
		System.out.println(formataData(hora));
	}
}
Success #stdin #stdout 0.23s 320832KB
stdin
Standard input is empty
stdout
13:32