Here you can find the source of parseTimeConfiguration(String time)
public static Date parseTimeConfiguration(String time) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat TIME_FORMAT_WITHOUT_SECONDS = new SimpleDateFormat("HH:mm"); public static final SimpleDateFormat TIME_FORMAT_WITHOUT_SECONDS_WITH_TIMEZONE = new SimpleDateFormat("HH:mmZ"); public static Date parseTimeConfiguration(String time) throws ParseException { try {// w ww.ja v a 2 s . co m return TIME_FORMAT_WITHOUT_SECONDS_WITH_TIMEZONE.parse(time); } catch (ParseException ex) { return TIME_FORMAT_WITHOUT_SECONDS.parse(time); } } }