code: public static Date getDateValue(JSONObject jsonObject, String key) throws JSONException {
  		checkArguments(jsonObject, key);
  		JSONValue value = jsonObject.get(key);
  		if (value != null && value.isString() != null) {
  			String dateString = getStringValue(jsonObject, key);
  			if (dateString.charAt(0) == '"') {
  				dateString = dateString.substring(1);
  			}
  			if (dateString.endsWith("\"")) {
  				dateString = dateString.substring(0, dateString.length() - 1);
  			}
  			try {
  				return DEFAULT_DATEFORMAT.parse(dateString);
  			} catch (Exception e) {
  				try {
  					long millis = Long.parseLong(dateString);
  					return new Date(millis);
  				} catch (Exception e2) {
  					throw new JSONException("Could not parse the date for key '" + key + "'", e);
  				}
  			}
  		}
  		return null;
  	}
docs: Get a date value from a {@link JSONObject}.
  
  @param jsonObject The object to get the key value from.
  @param key The name of the key to search the value for.
  @return Returns the value for the key in the object or null.
  @throws JSONException Thrown in case the key could not be found in the JSON object, or if the date could not be
  parsed correctly.