public Date value(Object o, Date dv) {
        if (o instanceof Date) {
            return (Date) o;
        } else if (o instanceof String) {
            String str = (String) o;
            try {
                if (str.length() == 8) {
                    return sfmt().parse(str);
                } else if (str.length() == 14) {
                    return lfmt().parse(str);
                } else {
                    log.debug("Can't cast date : " + o);
                    return dv;
                }
            } catch (Exception e) {
                log.debug("Can't cast date : " + o);
                return dv;
            }
        }
        return dv;
    }