public String toStringRfc3339(){
  StringBuilder sb=new StringBuilder();
  Calendar dateTime=new GregorianCalendar(GMT);
  long localTime=value + (tzShift * 60000L);
  dateTime.setTimeInMillis(localTime);
  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 == 0) {
      sb.append('Z');
    }
 else {
      int absTzShift=tzShift;
      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);
    }
  }
  return sb.toString();
}

public String toStringRfc3339 ( ) { StringBuilder sb = new StringBuilder ( ) ; Calendar dateTime = new GregorianCalendar ( GMT ) ; long localTime = value + ( tzShift * 60000L ) ; dateTime . setTimeInMillis ( localTime ) ; 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 == 0 ) { sb . append ( 'Z' ) ; } else { int absTzShift = tzShift ; 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 ) ; } } return sb . toString ( ) ; }
formats the value as an rfc 3339 date / time string .
