public static String encodeDateTime ( DateTimeField field ) { Date date = ( ( DateTimeField ) field ) . getDateTime ( ) ; if ( date == null ) return null ; if ( field instanceof TimeField ) return timeFormat . format ( date ) ; else if ( field instanceof DateField ) return dateFormat . format ( date ) ; else // if (field instanceof DateTimeField) return dateTimeFormat . format ( date ) ; }
Encode date time field .