Google Earth Engine – How to Filter Specific Dates in Google Earth Engine

dategoogle-earth-enginelandsat 8

I've called Landsat8 images from 2014 to 2019 using filter date function. But I don't know how can I call Landsat8 images only for June, July, and August from 2014 to 2019?

Map.centerObject(geometry);

var landsat = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterDate('2014-01-01','2019-01-01')
.filterBounds(geometry);

this is code's link:
https://code.earthengine.google.com/5c2959ec6adecfdefa817c37d74effe2

Best Answer

Use ee.Filter.calendarRange() on the image collection

// filte ron specific month:
var filter = ee.Filter.calendarRange(6,8, 'month');
var filterLandsat = landsat.filter(filter);

print(filterLandsat)

link