public String decodedDateTimeToIso8601String() {
    { DecodedDateTime date = this;

      { StringBuffer buffer = Stella.makeRawMutableString(25);
        int index = 0;

        if (date.dateTimeYear != Stella.NULL_INTEGER) {
          index = Stella.insertString(Native.integerToString(((long)(date.dateTimeYear))), 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
          if (date.dateTimeMonth != Stella.NULL_INTEGER) {
            index = Stella.insertString("-", 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
            index = Stella.insertString(Stella.formatWithPadding(Native.integerToString(((long)(date.dateTimeMonth))), 2, '0', Stella.KWD_RIGHT, false), 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
            if (date.dateTimeDay != Stella.NULL_INTEGER) {
              index = Stella.insertString("-", 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
              index = Stella.insertString(Stella.formatWithPadding(Native.integerToString(((long)(date.dateTimeDay))), 2, '0', Stella.KWD_RIGHT, false), 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
              if (date.dateTimeHour != Stella.NULL_INTEGER) {
                index = Stella.insertString("T", 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
                index = Stella.insertString(Stella.formatWithPadding(Native.integerToString(((long)(date.dateTimeHour))), 2, '0', Stella.KWD_RIGHT, false), 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
                if (date.dateTimeMinute != Stella.NULL_INTEGER) {
                  index = Stella.insertString(":", 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
                  index = Stella.insertString(Stella.formatWithPadding(Native.integerToString(((long)(date.dateTimeMinute))), 2, '0', Stella.KWD_RIGHT, false), 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
                  if (date.dateTimeSecond != Stella.NULL_INTEGER) {
                    index = Stella.insertString(":", 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
                    index = Stella.insertString(Stella.formatWithPadding(Native.integerToString(((long)(date.dateTimeSecond))), 2, '0', Stella.KWD_RIGHT, false), 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
                  }
                }
                if (date.dateTimeZone != Stella.NULL_FLOAT) {
                  if (date.dateTimeZone == 0.0) {
                    index = Stella.insertString("Z", 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
                  }
                  else {
                    index = Stella.insertString(Stella.timeZoneFormat60(date.dateTimeZone, true), 0, Stella.NULL_INTEGER, buffer, index, Stella.KWD_PRESERVE);
                  }
                }
              }
            }
          }
        }
        return (Native.mutableString_subsequence(buffer, 0, index));
      }
    }
  }