@Override public void setValueAsString(String theValue) throws DataFormatException { clearTimeZone(); super.setValueAsString(theValue); }
private BaseDateTimeDt setTimeZone(String theWholeValue, String theValue) { if (isBlank(theValue)) { throwBadDateFormat(theWholeValue); } else if (theValue.charAt(0) == 'Z') { clearTimeZone(); setTimeZoneZulu(true); } else if (theValue.length() != 6) { throwBadDateFormat(theWholeValue, "Timezone offset must be in the form \"Z\", \"-HH:mm\", or \"+HH:mm\""); } else if (theValue.charAt(3) != ':' || !(theValue.charAt(0) == '+' || theValue.charAt(0) == '-')) { throwBadDateFormat(theWholeValue, "Timezone offset must be in the form \"Z\", \"-HH:mm\", or \"+HH:mm\""); } else { parseInt(theWholeValue, theValue.substring(1, 3), 0, 23); parseInt(theWholeValue, theValue.substring(4, 6), 0, 59); clearTimeZone(); setTimeZone(TimeZone.getTimeZone("GMT" + theValue)); } return this; }
@Override public void setValueAsString(String theValue) throws DataFormatException { clearTimeZone(); super.setValueAsString(theValue); }
private BaseDateTimeDt setTimeZone(String theWholeValue, String theValue) { if (isBlank(theValue)) { throwBadDateFormat(theWholeValue); } else if (theValue.charAt(0) == 'Z') { clearTimeZone(); setTimeZoneZulu(true); } else if (theValue.length() != 6) { throwBadDateFormat(theWholeValue, "Timezone offset must be in the form \"Z\", \"-HH:mm\", or \"+HH:mm\""); } else if (theValue.charAt(3) != ':' || !(theValue.charAt(0) == '+' || theValue.charAt(0) == '-')) { throwBadDateFormat(theWholeValue, "Timezone offset must be in the form \"Z\", \"-HH:mm\", or \"+HH:mm\""); } else { parseInt(theWholeValue, theValue.substring(1, 3), 0, 23); parseInt(theWholeValue, theValue.substring(4, 6), 0, 59); clearTimeZone(); setTimeZone(TimeZone.getTimeZone("GMT" + theValue)); } return this; }