private String getDateTimeString ( Date value ) { String result = null ; if ( value != null ) { Calendar cal = DateHelper . popCalendar ( value ) ; StringBuilder sb = new StringBuilder ( 16 ) ; sb . append ( m_fourDigitFormat . format ( cal . get ( Calendar . YEAR ) ) ) ; sb . append ( m_twoDigitFormat . format ( cal . get ( Calendar . MONTH ) + 1 ) ) ; sb . append ( m_twoDigitFormat . format ( cal . get ( Calendar . DAY_OF_MONTH ) ) ) ; sb . append ( ' ' ) ; sb . append ( m_twoDigitFormat . format ( cal . get ( Calendar . HOUR_OF_DAY ) ) ) ; sb . append ( m_twoDigitFormat . format ( cal . get ( Calendar . MINUTE ) ) ) ; sb . append ( m_twoDigitFormat . format ( cal . get ( Calendar . SECOND ) ) ) ; sb . append ( ' ' ) ; result = sb . toString ( ) ; DateHelper . pushCalendar ( cal ) ; } return result ; }
Convert a Java date into a Planner date - time string .