Announcement: All noncommercial projects registered to use Earth Engine beforeApril 15, 2025 mustverify noncommercial eligibility to maintain access. If you have not verified by September 26, 2025, your access may be on hold.

ee.DateRange.intersection

  • TheDateRange.intersection() method returns a newDateRange object representing the overlapping period of the currentDateRange and another specifiedDateRange.

  • This method takes one argument,other, which is theDateRange to intersect with.

  • Examples are provided in both JavaScript and Python demonstrating how to find the intersection of twoee.DateRange objects.

Returns a DateRange that contains all points in the intersection of this DateRange and another.

UsageReturns
DateRange.intersection(other)DateRange
ArgumentTypeDetails
this:dateRangeDateRange
otherDateRange

Examples

Code Editor (JavaScript)

// A series of ee.DateRange objects.vardateRange1=ee.DateRange('2017-06-24','2017-07-24');vardateRange2=ee.DateRange('2017-07-01','2018-08-24');// Determine the intersection of two ee.DateRange objects.print('Intersection of dateRange1 and dateRange2',dateRange1.intersection(dateRange2));

Python setup

See the Python Environment page for information on the Python API and usinggeemap for interactive development.

importeeimportgeemap.coreasgeemap

Colab (Python)

# A series of ee.DateRange objects.date_range_1=ee.DateRange('2017-06-24','2017-07-24')date_range_2=ee.DateRange('2017-07-01','2018-08-24')# Determine the intersection of two ee.DateRange objects.display('Intersection of date_range_1 and date_range_2:',date_range_1.intersection(date_range_2))

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2023-10-06 UTC.