ee.DateRange.intersection
Returns a DateRange that contains all points in the intersection of this DateRange and another.
Usage | Returns |
---|
DateRange.intersection(other) | DateRange |
Argument | Type | Details |
---|
this: dateRange | DateRange | |
other | DateRange | |
Examples
// A series of ee.DateRange objects.
var dateRange1 = ee.DateRange('2017-06-24', '2017-07-24');
var dateRange2 = 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 using
geemap
for interactive development.
import ee
import geemap.core as geemap
# 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 the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["`DateRange.intersection()` returns a new `DateRange` representing the overlapping period between two `DateRange` objects."],["This function takes another `DateRange` as an argument and determines the common time span between the two."],["You can use this function to identify the period where both date ranges coincide for further analysis or filtering."],["Code examples are provided in JavaScript, Python, and Colab demonstrating how to use `DateRange.intersection()`."]]],["The `intersection()` method determines the overlapping period between two `DateRange` objects. It takes another `DateRange` as input (`other`). The method returns a new `DateRange` that represents the shared time interval between the original `DateRange` and the input `DateRange`. For example, intersecting '2017-06-24' to '2017-07-24' with '2017-07-01' to '2018-08-24' yields a DateRange from '2017-07-01' to '2017-07-24'.\n"]]