public StringBuffer format(Object pCalendar, StringBuffer pBuffer, FieldPosition pPos) { final Object cal; if (pCalendar != null && pCalendar instanceof Date) { Calendar calendar = Calendar.getInstance(getTimeZone()); calendar.setTime((Date) pCalendar); cal = calendar; } else { cal = pCalendar; } return super.format(cal, pBuffer, pPos); }
public Object parseObject(String pString, ParsePosition pParsePosition) { Calendar cal = (Calendar) super.parseObject(pString, pParsePosition); return cal == null ? null : cal.getTime(); } }
offset = parseInt(pString, offset, digits, 4); if (digits.length() < 4) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); Calendar cal = Calendar.getInstance(getTimeZone()); cal.set(year, month-1, mday, hour, minute, second); cal.set(Calendar.MILLISECOND, 0);
public StringBuffer format(Object pCalendar, StringBuffer pBuffer, FieldPosition pPos) { if (pCalendar == null) { throw new NullPointerException("The Calendar argument must not be null."); } if (pBuffer == null) { throw new NullPointerException("The StringBuffer argument must not be null."); } if (pPos == null) { throw new NullPointerException("The FieldPosition argument must not be null."); } Calendar cal = (Calendar) pCalendar; int year = cal.get(Calendar.YEAR); append(pBuffer, year, 4); append(pBuffer, cal.get(Calendar.MONTH)+1, 2); append(pBuffer, cal.get(Calendar.DAY_OF_MONTH), 2); pBuffer.append('T'); append(pBuffer, cal.get(Calendar.HOUR_OF_DAY), 2); pBuffer.append(':'); append(pBuffer, cal.get(Calendar.MINUTE), 2); pBuffer.append(':'); append(pBuffer, cal.get(Calendar.SECOND), 2); return pBuffer; } }
offset = parseInt(pString, offset, digits, 4); if (digits.length() < 4) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); Calendar cal = Calendar.getInstance(getTimeZone()); cal.set(year, month-1, mday, hour, minute, second); cal.set(Calendar.MILLISECOND, 0);
public StringBuffer format(Object pCalendar, StringBuffer pBuffer, FieldPosition pPos) { if (pCalendar == null) { throw new NullPointerException("The Calendar argument must not be null."); } if (pBuffer == null) { throw new NullPointerException("The StringBuffer argument must not be null."); } if (pPos == null) { throw new NullPointerException("The FieldPosition argument must not be null."); } Calendar cal = (Calendar) pCalendar; int year = cal.get(Calendar.YEAR); append(pBuffer, year, 4); append(pBuffer, cal.get(Calendar.MONTH)+1, 2); append(pBuffer, cal.get(Calendar.DAY_OF_MONTH), 2); pBuffer.append('T'); append(pBuffer, cal.get(Calendar.HOUR_OF_DAY), 2); pBuffer.append(':'); append(pBuffer, cal.get(Calendar.MINUTE), 2); pBuffer.append(':'); append(pBuffer, cal.get(Calendar.SECOND), 2); return pBuffer; } }
offset = parseInt(pString, offset, digits, 4); if (digits.length() < 4) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); offset = parseInt(pString, offset, digits, 2); if (digits.length() != 2) { pParsePosition.setErrorIndex(offset); Calendar cal = Calendar.getInstance(getTimeZone()); cal.set(year, month-1, mday, hour, minute, second); cal.set(Calendar.MILLISECOND, 0);
public StringBuffer format(Object pCalendar, StringBuffer pBuffer, FieldPosition pPos) { final Object cal; if (pCalendar != null && pCalendar instanceof Date) { Calendar calendar = Calendar.getInstance(getTimeZone()); calendar.setTime((Date) pCalendar); cal = calendar; } else { cal = pCalendar; } return super.format(cal, pBuffer, pPos); }
public Object parseObject(String pString, ParsePosition pParsePosition) { Calendar cal = (Calendar) super.parseObject(pString, pParsePosition); return cal == null ? null : cal.getTime(); } }
public StringBuffer format(Object pCalendar, StringBuffer pBuffer, FieldPosition pPos) { if (pCalendar == null) { throw new NullPointerException("The Calendar argument must not be null."); } if (pBuffer == null) { throw new NullPointerException("The StringBuffer argument must not be null."); } if (pPos == null) { throw new NullPointerException("The FieldPosition argument must not be null."); } Calendar cal = (Calendar) pCalendar; int year = cal.get(Calendar.YEAR); append(pBuffer, year, 4); append(pBuffer, cal.get(Calendar.MONTH)+1, 2); append(pBuffer, cal.get(Calendar.DAY_OF_MONTH), 2); pBuffer.append('T'); append(pBuffer, cal.get(Calendar.HOUR_OF_DAY), 2); pBuffer.append(':'); append(pBuffer, cal.get(Calendar.MINUTE), 2); pBuffer.append(':'); append(pBuffer, cal.get(Calendar.SECOND), 2); return pBuffer; } }
public StringBuffer format(Object pCalendar, StringBuffer pBuffer, FieldPosition pPos) { final Object cal; if (pCalendar != null && pCalendar instanceof Date) { Calendar calendar = Calendar.getInstance(getTimeZone()); calendar.setTime((Date) pCalendar); cal = calendar; } else { cal = pCalendar; } return super.format(cal, pBuffer, pPos); }
public Object parseObject(String pString, ParsePosition pParsePosition) { Calendar cal = (Calendar) super.parseObject(pString, pParsePosition); return cal == null ? null : cal.getTime(); } }