protected String formatDate(Date date) {
    try {
      synchronized (timeFormatter) {
        // Need sync: see bug 21858
        return timeFormatter.format(date);
      }
    } catch (Exception e1) {
      // Fix bug 21857
      try {
        return date.toString();
      } catch (Exception e2) {
        try {
          return Long.toString(date.getTime());
        } catch (Exception e3) {
          return "timestampFormatFailed";
        }
      }
    }
  }
Convert a Date to a timestamp String.

@param date a Date to format as a timestamp String.
@return a String representation of the current time.
geode-core/src/main/java/org/apache/geode/internal/logging/LogWriterImpl.java