question: public static String toDateString ( java . util . Date date , String format ) { if ( date == null ) return "" ; SimpleDateFormat dateFormat = null ; if ( format != null ) { dateFormat = new SimpleDateFormat ( format ) ; } else { dateFormat = new SimpleDateFormat ( ) ; } Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( date ) ; return dateFormat . format ( date ) ; }
target:  Makes a date String in the given from a Date