import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
class Main {
public static Date parseDate(String date, String format) throws ParseException {
if (date == null || date.length() == 0) {
return null;
}
SimpleDateFormat dateFormat = new SimpleDateFormat(format);
return dateFormat.parse(date);
}
public static Date parseDate(String date) throws ParseException {
return parseDate(date, "dd.MM.yyyy");
}
public static Date parseShortDate(String date) throws ParseException {
return parseDate(date, "dd.MM.yy");
}
public static Date parseTime(String date) throws ParseException {
return parseDate(date, "HH:mm");
}
public static Date parseDateTime(String date) throws ParseException {
return parseDate(date, "dd.MM.yyyy HH:mm");
}
public static Date parseTimeDate(String date) throws ParseException {
return parseDate(date, "HH:mm dd.MM.yyyy");
}
}