public static String parseDateWithoutFraction ( String date ) { if ( date == null ) return "" ; if ( date . length ( ) < 20 ) { return date ; } return date . substring ( 0 , 19 ) ; }
This is weird but way faster than Java date time formatter etc .