public static Date getInstance ( final java . util . Date date , final Value type ) { if ( Value . DATE . equals ( type ) ) { return new Date ( date ) ; } return new DateTime ( date ) ; }
Returns a new date instance of the specified type . If no type is specified a DateTime instance is returned .