appendZeroPaddedInt(buf, getYear(cal), 4); buf.append('-'); appendZeroPaddedInt(buf, cal.get(Calendar.MONTH) + 1, 2); buf.append('-'); appendZeroPaddedInt(buf, cal.get(Calendar.DAY_OF_MONTH), 2); buf.append('T'); appendZeroPaddedInt(buf, cal.get(Calendar.HOUR_OF_DAY), 2); buf.append(':'); appendZeroPaddedInt(buf, cal.get(Calendar.MINUTE), 2); buf.append(':'); appendZeroPaddedInt(buf, cal.get(Calendar.SECOND), 2); buf.append('.'); appendZeroPaddedInt(buf, cal.get(Calendar.MILLISECOND), 3); int minutes = Math.abs((offset / (60 * 1000)) % 60); buf.append(offset < 0 ? '-' : '+'); appendZeroPaddedInt(buf, hours, 2); buf.append(':'); appendZeroPaddedInt(buf, minutes, 2); } else { buf.append('Z');
appendZeroPaddedInt(buf, getYear(cal), 4); buf.append('-'); appendZeroPaddedInt(buf, cal.get(Calendar.MONTH) + 1, 2); buf.append('-'); appendZeroPaddedInt(buf, cal.get(Calendar.DAY_OF_MONTH), 2); buf.append('T'); appendZeroPaddedInt(buf, cal.get(Calendar.HOUR_OF_DAY), 2); buf.append(':'); appendZeroPaddedInt(buf, cal.get(Calendar.MINUTE), 2); buf.append(':'); appendZeroPaddedInt(buf, cal.get(Calendar.SECOND), 2); buf.append('.'); appendZeroPaddedInt(buf, cal.get(Calendar.MILLISECOND), 3); int minutes = Math.abs((offset / (60 * 1000)) % 60); buf.append(offset < 0 ? '-' : '+'); appendZeroPaddedInt(buf, hours, 2); buf.append(':'); appendZeroPaddedInt(buf, minutes, 2); } else { buf.append('Z');
appendZeroPaddedInt(buf, getYear(cal), 4); buf.append('-'); appendZeroPaddedInt(buf, cal.get(Calendar.MONTH) + 1, 2); buf.append('-'); appendZeroPaddedInt(buf, cal.get(Calendar.DAY_OF_MONTH), 2); buf.append('T'); appendZeroPaddedInt(buf, cal.get(Calendar.HOUR_OF_DAY), 2); buf.append(':'); appendZeroPaddedInt(buf, cal.get(Calendar.MINUTE), 2); buf.append(':'); appendZeroPaddedInt(buf, cal.get(Calendar.SECOND), 2); buf.append('.'); appendZeroPaddedInt(buf, cal.get(Calendar.MILLISECOND), 3); int minutes = Math.abs((offset / (60 * 1000)) % 60); buf.append(offset < 0 ? '-' : '+'); appendZeroPaddedInt(buf, hours, 2); buf.append(':'); appendZeroPaddedInt(buf, minutes, 2); } else { buf.append('Z');