ee.DateRange.intersection Stay organized with collections Save and categorize content based on your preferences.
Page Summary
The
DateRange.intersection()method returns a newDateRangeobject representing the overlapping period of the currentDateRangeand another specifiedDateRange.This method takes one argument,
other, which is theDateRangeto intersect with.Examples are provided in both JavaScript and Python demonstrating how to find the intersection of two
ee.DateRangeobjects.
| Usage | Returns |
|---|---|
DateRange.intersection(other) | DateRange |
| Argument | Type | Details |
|---|---|---|
this:dateRange | DateRange | |
other | DateRange |
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.