public static String formatTimeISO8601 ( TimeValue value ) { StringBuilder builder = new StringBuilder ( ) ; DecimalFormat yearForm = new DecimalFormat ( FORMAT_YEAR ) ; DecimalFormat timeForm = new DecimalFormat ( FORMAT_OTHER ) ; if ( value . getYear ( ) > 0 ) { builder . append ( "+" ) ; } builder . append ( yearForm . format ( value . getYear ( ) ) ) ; builder . append ( "-" ) ; builder . append ( timeForm . format ( value . getMonth ( ) ) ) ; builder . append ( "-" ) ; builder . append ( timeForm . format ( value . getDay ( ) ) ) ; builder . append ( "T" ) ; builder . append ( timeForm . format ( value . getHour ( ) ) ) ; builder . append ( ":" ) ; builder . append ( timeForm . format ( value . getMinute ( ) ) ) ; builder . append ( ":" ) ; builder . append ( timeForm . format ( value . getSecond ( ) ) ) ; builder . append ( "Z" ) ; return builder . toString ( ) ; }
Returns a representation of the date from the value attributes as ISO 8601 encoding .