meridian.data.time_coordinates.normalize_date_interval
Stay organized with collections
Save and categorize content based on your preferences.
Normalizes representations of a date interval into a tuple of dates.
meridian.data.time_coordinates.normalize_date_interval(
date_interval: meridian.data.time_coordinates.DateInterval
) -> tuple[datetime.date, datetime.date]
A date interval here is a tuple of [start_date, end_date) where:
start_date is inclusive and end_date is exclusive.
- Both are polymorphic, taking the form of either:
datetime.datetime (only the date component will be used)
datetime.date (the normalized form)
np.datetime64 (only the date component will be used)
str (will be parsed as "YYYY-mm-dd" or else throws)
In all instances, the given date interval will be normalized as a tuple of
datetime.dates.
Args |
date_interval
|
a polymorphic date interval to normalize.
|
Returns |
A tuple of dates representing a [start_date, end_date) date interval.
|
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 2026-06-17 UTC.
[null,null,["Last updated 2026-06-17 UTC."],[],["The function `normalize_date_interval` converts a date interval into a tuple of `datetime.date` objects. It accepts a polymorphic `date_interval` which can be a tuple containing `datetime.datetime`, `datetime.date`, `np.datetime64`, or a \"YYYY-mm-dd\" formatted `str`. It returns a tuple with `start_date` and `end_date`, where `start_date` is inclusive and `end_date` is exclusive. Only the date component is utilized for `datetime` and `np.datetime64`.\n"]]