code: function (value) {
          /// <summary>Formats a DateTime or DateTimeOffset value a string.</summary>
          /// <param name="value" type="Date" mayBeNull="false">Value to format.</param>
          /// <returns type="String">Formatted text.</returns>
          /// <remarks>If the value is already as string it's returned as-is.</remarks>
  
          if (typeof value === "string") {
              return value;
          }
  
          var hasOffset = isDateTimeOffset(value);
          var offset = getCanonicalTimezone(value.__offset);
          if (hasOffset && offset !== "Z") {
              // We're about to change the value, so make a copy.
              value = new Date(value.valueOf());
  
              var timezone = parseTimezone(offset);
              var hours = value.getUTCHours() + (timezone.d * timezone.h);
              var minutes = value.getMinutes() + (timezone.d * timezone.m);
  
              value.setUTCHours(hours, minutes);
          } else if (!hasOffset) {
              // Don't suffix a 'Z' for Edm.DateTime values.
              offset = "";
          }
  
          var year = value.getUTCFullYear();
          var month = value.getUTCMonth() + 1;
          var sign = "";
          if (year <= 0) {
              year = -(year - 1);
              sign = "-";
          }
  
          var ms = formatMilliseconds(value.getUTCMilliseconds(), value.__ns);
  
          return sign +
              formatNumberWidth(year, 4) + "-" +
              formatNumberWidth(month, 2) + "-" +
              formatNumberWidth(value.getUTCDate(), 2) + "T" +
              formatNumberWidth(value.getUTCHours(), 2) + ":" +
              formatNumberWidth(value.getUTCMinutes(), 2) + ":" +
              formatNumberWidth(value.getUTCSeconds(), 2) +
              ms + offset;
      }
docs: ##### END: MODIFIED BY SAP