code: private static Date getDateOrNull(JSONObject obj, String field)
  			throws JSONException {
  		String dateStr = JsonInput.getStringOrNull(obj, field);
  		if (dateStr == null)
  			return null;
  		try {
  			if (dateStr.length() >= 5 && dateStr.charAt(4) == '/') {
  				return RedmineDateUtils.FULL_DATE_FORMAT.get().parse(dateStr);
  			}
  			if (dateStr.endsWith("Z")) {
  				dateStr = dateStr.substring(0, dateStr.length() - 1)
  						+ "GMT-00:00";
  			} else {
  				final int inset = 6;
  				if (dateStr.length() <= inset)
  					throw new JSONException("Bad date value " + dateStr);
  				String s0 = dateStr.substring(0, dateStr.length() - inset);
  				String s1 = dateStr.substring(dateStr.length() - inset,
  						dateStr.length());
  				dateStr = s0 + "GMT" + s1;
  			}
  			return RedmineDateUtils.FULL_DATE_FORMAT_V2.get().parse(dateStr);
  		} catch (ParseException e) {
  			throw new JSONException("Bad date value " + dateStr);
  		}
  	}
docs: Fetches an optional date from an object.
  
  @param obj
  object to get a field from.
  @param field
  field to get a value from.
  @throws RedmineFormatException
  if value is not valid