code: @UserFunction( "apoc.temporal.format" )
      @Description( "apoc.temporal.format(input, format) | Format a temporal value" )
      public String format(
              @Name( "temporal" ) Object input,
              @Name( value = "format", defaultValue = "yyyy-MM-dd") String format
      ) {
  
          try {
              DateTimeFormatter formatter = getOrCreate(format);
  
              if (input instanceof LocalDate) {
                  return ((LocalDate) input).format(formatter);
              } else if (input instanceof ZonedDateTime) {
                  return ((ZonedDateTime) input).format(formatter);
              } else if (input instanceof LocalDateTime) {
                  return ((LocalDateTime) input).format(formatter);
              } else if (input instanceof LocalTime) {
                  return ((LocalTime) input).format(formatter);
              } else if (input instanceof OffsetTime) {
                  return ((OffsetTime) input).format(formatter);
              } else if (input instanceof DurationValue) {
                  return formatDuration(input, format);
              }
          } catch (Exception e){
              throw new RuntimeException("Available formats are:\n" +
                      String.join("\n", getTypes()) +
                      "\nSee also: https://www.elastic.co/guide/en/elasticsearch/reference/5.5/mapping-date-format.html#built-in-date-formats " +
                      "and https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html");
          }
          return input.toString();
      }
docs: Format a temporal value to a String
  
  @param input     Any temporal type
  @param format    A valid DateTime format pattern (ie yyyy-MM-dd'T'HH:mm:ss.SSSS)
  @return