src/main/java/com/teamunify/i18n/I.java
@SuppressWarnings("deprecation")
  public static Date stringToTime(Date refDate, String timeString) {
    if (isNullDate(refDate)) {
      if (defaultDate == null)
        refDate = new Date();
      else
        refDate = defaultDate;
    }
    Date timeDate = new Date(0, 0, 0, 0, 0, 0);

    LanguageSetting s = languageProvider.vend();
    for (DateFormat fmt : new DateFormat[] { s.getLongTimeFormat(), s.getShortTimeFormat(),
                                             s.getMilitaryTimeFormat(true), s.getMilitaryTimeFormat(false),
                                             s.getAccurateTimeFormat(), s.getCompactMilitaryTimeFormat() }) {
      try {
        timeDate = fmt.parse(timeString);
        break;
      } catch (ParseException e) {}
    }

    return new Date(refDate.getYear(), refDate.getMonth(), refDate.getDate(), timeDate.getHours(),
                    timeDate.getMinutes(), timeDate.getSeconds());
  }
/**
   * Given a reference date, set the time in it using the given string. E.g. treat the date as a pure date (no time),
   * and add the time into it.
   *
   * @param refDate    The date to use for the date portion
   * @param timeString The string to parse the time from. If the time does not include an am/pm, then it is assumed to be 24-hour
   *                   time.
   * @return A new date object, with the date from refDate, and time from timeString. Returns defaultDate if time cannot
   * be parsed.
   */
Given a reference date, set the time in it using the given string.

@param refDate    The date to use for the date portion
@param timeString The string to parse the time from. If the time does not include an am/pm, then it is assumed to be 24-hour
time.
@return A new date object, with the date from refDate, and time from timeString. Returns defaultDate if time cannot
be parsed.
Given a reference date set the time in it using the given string . @param refDate The date to use for the date portion @param timeString The string to parse the time from . If the time does not include an am / pm then it is assumed to be 24 - hour time . @return A new date object with the date from refDate and time from timeString . Returns defaultDate if time cannot be parsed .
@SuppressWarnings("deprecation")
  public static Date stringToTime(Date refDate, String timeString) {
    if (isNullDate(refDate)) {
      if (defaultDate == null)
        refDate = new Date();
      else
        refDate = defaultDate;
    }
    Date timeDate = new Date(0, 0, 0, 0, 0, 0);
    LanguageSetting s = languageProvider.vend();
    for (DateFormat fmt : new DateFormat[] { s.getLongTimeFormat(), s.getShortTimeFormat(),
                                             s.getMilitaryTimeFormat(true), s.getMilitaryTimeFormat(false),
                                             s.getAccurateTimeFormat(), s.getCompactMilitaryTimeFormat() }) {
      try {
        timeDate = fmt.parse(timeString);
        break;
      } catch (ParseException e) {}
    }
    return new Date(refDate.getYear(), refDate.getMonth(), refDate.getDate(), timeDate.getHours(),
                    timeDate.getMinutes(), timeDate.getSeconds());
  }
@ SuppressWarnings ( "deprecation" ) public static Date stringToTime ( Date refDate , String timeString ) { if ( isNullDate ( refDate ) ) { if ( defaultDate == null ) refDate = new Date ( ) ; else refDate = defaultDate ; } Date timeDate = new Date ( 0 , 0 , 0 , 0 , 0 , 0 ) ; LanguageSetting s = languageProvider . vend ( ) ; for ( DateFormat fmt : new DateFormat [ ] { s . getLongTimeFormat ( ) , s . getShortTimeFormat ( ) , s . getMilitaryTimeFormat ( true ) , s . getMilitaryTimeFormat ( false ) , s . getAccurateTimeFormat ( ) , s . getCompactMilitaryTimeFormat ( ) } ) { try { timeDate = fmt . parse ( timeString ) ; break ; } catch ( ParseException e ) { } } return new Date ( refDate . getYear ( ) , refDate . getMonth ( ) , refDate . getDate ( ) , timeDate . getHours ( ) , timeDate . getMinutes ( ) , timeDate . getSeconds ( ) ) ; }
Given a reference date, set the time in it using the given string.
Given a reference date set the time in it using the given string .