code: function toTechFormat(dt, format) {
    return dt.isValid
      ? Formatter.create(Locale.create("en-US"), {
          allowZ: true,
          forceSimple: true
        }).formatDateTimeFromString(dt, format)
      : null;
  }
docs: if you want to output a technical format (e.g. RFC 2822), this helper helps handle the details