print dates in GEE

When were these pictures taken?

Step 1: Import the sentinel-2 image collection. Give it the name s2

Step 2: Add a marker at your location of interest.

Step 3: Add the code below:

// filter for the location
var f = s2.filterBounds(geometry);

// print the number of files
print(f.size());

// put all dates in a list
var dates = ee.List(f.aggregate_array("system:time_start"))
    .map(function(d) { return ee.Date(d)});

// print a list with dates
print(dates);

See an example here!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s