Try
Dates.format.(dts, dateformat"yyyymm");
instead. See the docs:
Creating a DateFormat object is expensive. Whenever
possible, create it once and use it many times or try the
dateformat"" string macro. Using this macro creates the
DateFormat object once at macro expansion time and reuses it
later. see @dateformat_str.