Download CSV with formatted date

31 Views Asked by At

In Google Sheets Script I have the following array

  data.forEach(function(row){
    if(row[0]==""){
      results.push([row[1],row[4].toString(Utilities.formatDate(row[4],"GMT-5","yyyy-MM-dd")));
      row[0] = "Exported";
    }           
  });
  //Use SetValues to set results[] to sheet
  //Download file as CSV

The problem I'm having is that the date still shows in Long format in the CSV file instead of the format I have set. The sheet shows it in the correct format.

Thanks for your help.

Google Sheets result

CSV result

0

There are 0 best solutions below