class DateFormatter implements ParamConverter<Date> {

    @Override
    public Date fromString(String s) {
        Date d;
        synchronized (DateFormatter.dateFormat) {
            String str = s;
            if (str.equals("+24Hours")) {
                d = new Date(new Date().getTime() + 86400000);
                log.debug("Param passed in was '+24Hours', setting value to now + 86400000ms");
            } else {
                if (StringUtils.isNotBlank(this.defaultTime) && !str.contains(" ")) {
                    str = str + " " + this.defaultTime;
                }
                
                if (StringUtils.isNotBlank(this.defaultMillisec) && !str.contains(".")) {
                    str = str + "." + this.defaultMillisec;
                }
                
                try {
                    d = DateFormatter.dateFormat.parse(str);
                    // if any time value in HHmmss was set either by default or by the user
                    // then we want to include ALL of that second by setting the milliseconds to 999
                    if (DateUtils.getFragmentInMilliseconds(d, Calendar.HOUR_OF_DAY) > 0) {
                        DateUtils.setMilliseconds(d, 999);
                    }
                } catch (ParseException pe) {
                    throw new RuntimeException("Unable to parse date " + str + " with format " + formatPattern, pe);
                }
            }
        }
        
        return d;
    }

    public  DateFormatter(DateFormat format);

}