code: private static String formatDate(Date date) {
  
          String dateStr = dateFormat.format(date);
          // insert colon into timezone
          return dateStr.substring(0, 22) + ":" + dateStr.substring(22);
      }
docs: Helper method to format a date in the W3C datetime format.<p>
  
  @param date the date to format
  
  @return the formatted date