title: How to export a csv file from Google Earth Engine with attribute data and associated dates in a user defined date format?
body: <p>Good Day</p>
  <p>I am trying to generate an Enhanced Vegetation Index (EVI) in Google Earth Engine using Landsat 7 and 8 data. I have compiled the code below to filter the image collections, for a specific time period and region of interest, as well as to mask out a majority of the cloud cover in the images. I have then proceeded to calculate the EVI and add these values to the image collections as an attribute that I can select for further processing. I have undertaken this process separately for Landsat 7 and Landsat 8. However, since I am interested in the EVI that is generated from both these data sets I have merged these into one image collection.</p>
  <p>Using this image collection, I would like to calculate the mean EVI value for a particular region of interest and then export these values along with the associated date (in the format dd-mm-yyyy) as a &quot;.csv&quot; file. I am aware that this is possible by clicking on the chart that is generated and downloading the associated &quot;.csv&quot; file or by exporting the data using the &quot;Export.table.toDrive&quot; function. However, none of these options provide the output in the structure as shown in the table below.</p>
  <p><a href="https://i.stack.imgur.com/q8TxT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q8TxT.png" alt="enter image description here" /></a></p>
  <p>A sample of the code is provided here. Any assistance with this will be greatly appreciated. Kind Regards.</p>
  <pre><code>/// Add region of interest
  var ROI = ee.FeatureCollection(&quot;users/shaedengokool/Eben_Sluis_15YO&quot;)
  Map.addLayer(ROI, {}, 'ROI')
  Map.centerObject(ROI, 10)
  
  //1. Import the Landsat 8 TOA image collection.
  var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
                .filterDate('2002-01-01','2020-01-01')
                .filterBounds(ROI)
                .map(function(image){return image.clip(ROI)})
                
  var L8cloudlessEVI = l8.map(function(image) {
    // Get a cloud score in [0, 100].
    var cloud = ee.Algorithms.Landsat.simpleCloudScore(image).select('cloud');
  
    // Create a mask of cloudy pixels from an arbitrary threshold.
    var mask = cloud.lte(10);
  
    // Compute EVI.
    var evi = image.expression(
      '2.5 * ((NIR - RED) / (NIR + 6 * RED - 7.5 * BLUE + 1))', {
        'NIR': image.select('B5'),
        'RED': image.select('B4'),
        'BLUE': image.select('B2')
  }).rename('EVI');
  
    // Return the masked image with an EVI band.
    return image.addBands(evi).updateMask(mask);
  });
  
  var L8EVI_collection = L8cloudlessEVI
  
  //2. Import the Landsat 7 TOA image collection.
  var l7 = ee.ImageCollection('LANDSAT/LE07/C01/T1_TOA')
                .filterDate('2002-01-01','2020-01-01')
                .filterBounds(ROI)
                .map(function(image){return image.clip(ROI)})
  
  var L7cloudlessEVI = l7.map(function(image) {
    // Get a cloud score in [0, 100].
    var cloud = ee.Algorithms.Landsat.simpleCloudScore(image).select('cloud');
  
    // Create a mask of cloudy pixels from an arbitrary threshold.
    var mask = cloud.lte(10);
  
    // Compute EVI.
    var evi = image.expression(
      '2.5 * ((NIR - RED) / (NIR + 6 * RED - 7.5 * BLUE + 1))', {
        'NIR': image.select('B4'),
        'RED': image.select('B3'),
        'BLUE': image.select('B1')
  }).rename('EVI');
  
    // Return the masked image with an EVI band.
    return image.addBands(evi).updateMask(mask);
  });
  
  var L7EVI_collection = L7cloudlessEVI
  
  var merged = ee.ImageCollection(L7EVI_collection.merge(L8EVI_collection));
  print(merged, 'Merged')
  
  var chart = ui.Chart.image.series({
      imageCollection: merged.select('EVI'),
      region: ROI,
      reducer: ee.Reducer.mean(),
      scale: 30,
  })
  
  print(chart, &quot;EVI&quot;)
  
  // get the mean value for the region from each image
  var meanEVI = merged.map(function(image){
    var date = image.get('system:time_start');
    var mean = image.reduceRegion({
      reducer: ee.Reducer.mean(),
      geometry: ROI,
      scale: 30
    });
    // and return a feature with 'null' geometry with properties (dictionary)  
    return ee.Feature(null, {'mean': mean.get('EVI'),
                              'date': date})
  });
  
  // Export a .csv table of date, mean NDVI for watershed
  Export.table.toDrive({
    collection: meanEVI,
    description: 'EVI_Timeseries',
    folder: 'Genus_Exchange_GEE_Data',
    fileFormat: 'CSV',
  })
  </code></pre>
  <p>;</p>