@Override public String toString(){
  StringBuilder sb=new StringBuilder();
  Calendar dateTime=new GregorianCalendar(GMT);
  long localTime=value;
  if (tzShift != null) {
    localTime+=tzShift.longValue() * 60000;
  }
  dateTime.setTimeInMillis(localTime);
  try {
    appendInt(sb,dateTime.get(Calendar.YEAR),4);
    sb.append('-');
    appendInt(sb,dateTime.get(Calendar.MONTH) + 1,2);
    sb.append('-');
    appendInt(sb,dateTime.get(Calendar.DAY_OF_MONTH),2);
    if (!dateOnly) {
      sb.append('T');
      appendInt(sb,dateTime.get(Calendar.HOUR_OF_DAY),2);
      sb.append(':');
      appendInt(sb,dateTime.get(Calendar.MINUTE),2);
      sb.append(':');
      appendInt(sb,dateTime.get(Calendar.SECOND),2);
      if (dateTime.isSet(Calendar.MILLISECOND)) {
        sb.append('.');
        appendInt(sb,dateTime.get(Calendar.MILLISECOND),3);
      }
    }
    if (tzShift != null) {
      if (tzShift.intValue() == 0) {
        sb.append('Z');
      }
 else {
        int absTzShift=tzShift.intValue();
        if (tzShift > 0) {
          sb.append('+');
        }
 else {
          sb.append('-');
          absTzShift=-absTzShift;
        }
        int tzHours=absTzShift / 60;
        int tzMinutes=absTzShift % 60;
        appendInt(sb,tzHours,2);
        sb.append(':');
        appendInt(sb,tzMinutes,2);
      }
    }
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    throw new RuntimeException(e);
  }
  return sb.toString();
}

@ Override public String toString ( ) { StringBuilder sb = new StringBuilder ( ) ; Calendar dateTime = new GregorianCalendar ( GMT ) ; long localTime = value ; if ( tzShift != null ) { localTime += tzShift . longValue ( ) * 60000 ; } dateTime . setTimeInMillis ( localTime ) ; try { appendInt ( sb , dateTime . get ( Calendar . YEAR ) , 4 ) ; sb . append ( '-' ) ; appendInt ( sb , dateTime . get ( Calendar . MONTH ) + 1 , 2 ) ; sb . append ( '-' ) ; appendInt ( sb , dateTime . get ( Calendar . DAY_OF_MONTH ) , 2 ) ; if ( ! dateOnly ) { sb . append ( 'T' ) ; appendInt ( sb , dateTime . get ( Calendar . HOUR_OF_DAY ) , 2 ) ; sb . append ( ':' ) ; appendInt ( sb , dateTime . get ( Calendar . MINUTE ) , 2 ) ; sb . append ( ':' ) ; appendInt ( sb , dateTime . get ( Calendar . SECOND ) , 2 ) ; if ( dateTime . isSet ( Calendar . MILLISECOND ) ) { sb . append ( '.' ) ; appendInt ( sb , dateTime . get ( Calendar . MILLISECOND ) , 3 ) ; } } if ( tzShift != null ) { if ( tzShift . intValue ( ) == 0 ) { sb . append ( 'Z' ) ; } else { int absTzShift = tzShift . intValue ( ) ; if ( tzShift > 0 ) { sb . append ( '+' ) ; } else { sb . append ( '-' ) ; absTzShift = - absTzShift ; } int tzHours = absTzShift / 60 ; int tzMinutes = absTzShift % 60 ; appendInt ( sb , tzHours , 2 ) ; sb . append ( ':' ) ; appendInt ( sb , tzMinutes , 2 ) ; } } } catch ( ArrayIndexOutOfBoundsException e ) { throw new RuntimeException ( e ) ; } return sb . toString ( ) ; }
formats the value as an xs : date or xs : datetime string .
