code: public static String encodeDate(Date date) {
  		SimpleDateFormat dateFormatter = new SimpleDateFormat(dateFormat);
  		dateFormatter.setTimeZone(TimeZone.getTimeZone(UTC_TZ_ID));
  		/* Java doesn't handle ISO8601 nicely: need to add ':' manually */
  		String result = dateFormatter.format(date);
  		return result.substring(0, result.length() - ENCODE_DATE_COLONS_INDEX) + ":"
  				+ result.substring(result.length() - ENCODE_DATE_COLONS_INDEX);
  	}
docs: Encodes date value into string format that can be compared lexicographically
  
  @param date
  date value to be encoded
  @return string representation of the date value