import java.text.SimpleDateFormat;
import java.util.Date;

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
        String str = "2019-05-24T00:59:55.1-05:00";

        // Remove the colon in the timezone indicator
        // Not sure when Java got assert, so commenting this out: assert str.charAt(str.length() - 3) == ':';
        str = str.substring(0, str.length() - 3) + str.substring(str.length() - 2);
        // Parse the result
        Date dt = (new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")).parse(str);
        System.out.println(dt.toString());
	}
}