public static java . sql . Date toDate ( Object value ) throws ParseException { if ( value == null ) { return null ; } if ( value instanceof java . sql . Date ) { return ( java . sql . Date ) value ; } if ( value instanceof String ) { if ( "" . equals ( ( String ) value ) ) { return null ; } return new java . sql . Date ( IN_DATE_FORMAT . parse ( ( String ) value ) . getTime ( ) ) ; } return new java . sql . Date ( IN_DATE_FORMAT . parse ( value . toString ( ) ) . getTime ( ) ) ; }
Convert an Object to a Date .