DateBounds[{date1,date2,…}]
gives the earliest and latest of the datei.
DateBounds[obj]
gives the start and end dates associated with a given data object obj.
DateBounds[obj,gran]
gives the endpoints of interval in the specified granularity gran.
DateBounds
DateBounds[{date1,date2,…}]
gives the earliest and latest of the datei.
DateBounds[obj]
gives the start and end dates associated with a given data object obj.
DateBounds[obj,gran]
gives the endpoints of interval in the specified granularity gran.
Details
- DateBounds[dates] accepts dates in all standard date notations, including DateObject, DateList, AbsoluteTime and DateString formats.
- DateBounds[obj] will give the date bounds of an object with implicit or explicit time stamp information. Common obj specifications include DateInterval, TimeSeries, EventSeries and Databin.
- For lists of dates, DateBounds returns dates in the same form in which they were given. For TemporalData and Databin, DateObject expressions are returned.
- DateBounds[tseries] works on all forms of TemporalData, including TimeSeries and EventSeries.
Examples
open all close allBasic Examples (3)
Find the first and last dates in a list of date objects:
DateBounds[{DateObject[{2022, 4, 8}, "Day"], DateObject[{2022, 4, 9}, "Day"], DateObject[{2022, 4, 7}, "Day"]}]Find the first and last dates associated with a DateInterval:
DateBounds[DateInterval[{DateObject[{2025, 8, 24}, "Day"], DateObject[{2025, 8, 25, 13, 47, 31.169890}, "Instant", "Gregorian", -5.]}]]Find the temporal bounds of a TimeSeries as "Day" granular objects:
ts = FinancialData["NYSE:GE", DateObject[{2020, 1, 1}, "Day"]]DateBounds[ts, "Day"]Scope (4)
Find the first and last dates in a list of dates in different forms:
DateBounds[{DateObject[{2022}], "1950 Jan 4th", 3867285330, {2023, 1, 1}}]Find the temporal bounds of an EventSeries:
es = EarthquakeData[All, 8, {{2020, 1, 1}, {2022, 5, 16}}, "Magnitude"]DateBounds[es]Find the temporal bounds of a Databin:
bin = Databin["1qGFQ8v"]DateBounds[bin]If only one date is given in the input, it will be returned as the first and last date:
DateBounds[{Today}]Properties & Relations (5)
DateBounds returns the Min and Max associated with a list of DateObject expressions:
dates = {DateObject[{2021, 8, 4}, "Day"], DateObject[{2007, 1, 5}, "Day"], DateObject[{2024, 10, 13}, "Day"], DateObject[{2020, 12, 23}, "Day"]};DateBounds[dates]Min[dates]Max[dates]MinMax returns the same results as DateBounds if the input is a list of date objects:
dates = {DateObject[{2021, 8, 4}, "Day"], DateObject[{2007, 1, 5}, "Day"], DateObject[{2024, 10, 13}, "Day"], DateObject[{2020, 12, 23}, "Day"]};MinMax[dates]DateBounds[ts] returns the dates corresponding to ts["FirstDate"] and ts["LastDate"]:
moon = MoonPosition[DateRange[DateObject[{2022, 1, 1}], DateObject[{2022, 1, 31}], 1]]DateBounds[moon]moon["FirstDate"]moon["LastDate"]These are also the Min and Max values of ts["DateList"]:
MinMax[moon["DateList"]]DateBounds[bin] returns the dates corresponding to bin["TimeInterval"]:
bin = Databin["2akVuNN2"]DateBounds[bin]bin["TimeInterval"]These are also the Min and Max values of bin["Timestamps"]:
MinMax[bin["Timestamps"]]DateBounds accounts for differences in TimeZone when determining the first and last date:
DateBounds[{DateObject[{2022, 5, 10, 15, 52}, "Minute", "Gregorian", -4.], DateObject[{2022, 5, 2, 15, 52}, "Minute", "Gregorian", 0.], DateObject[{2022, 5, 5, 15, 52}, "Minute", "Gregorian", -7.]}]For dates that are not a DateObject, $TimeZone is assumed:
DateBounds[{DateObject[{2022, 5, 10, 15, 52}, "Minute", "Gregorian", -4.], DateObject[{2022, 5, 2, 15, 52}, "Minute", "Gregorian", 0.], DateObject[{2022, 5, 5, 15, 52}, "Minute", "Gregorian", -7.], "May 10th, 2022 16:00"}]Block[{$TimeZone = 0}, DateBounds[{DateObject[{2022, 5, 10, 15, 52}, "Minute", "Gregorian", -4.], DateObject[{2022, 5, 2, 15, 52}, "Minute", "Gregorian", 0.], DateObject[{2022, 5, 5, 15, 52}, "Minute", "Gregorian", -7.], "May 10th, 2022 16:00"}]
]Neat Examples (1)
Compare the date bounds associated with different databins:
bins = {
Databin["3wq7Nk7W"],
Databin["2akVuNN2"],
Databin["2anlZF8U"],
Databin["2anHvIz1"]
};dates = DateBounds /@ binsVisualize the overlap between databins using TimelinePlot:
TimelinePlot[Interval /@ dates]Related Guides
Text
Wolfram Research (2016), DateBounds, Wolfram Language function, https://reference.wolfram.com/language/ref/DateBounds.html (updated 2020).
CMS
Wolfram Language. 2016. "DateBounds." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/DateBounds.html.
APA
Wolfram Language. (2016). DateBounds. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DateBounds.html
BibTeX
@misc{reference.wolfram_2026_datebounds, author="Wolfram Research", title="{DateBounds}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/DateBounds.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_datebounds, organization={Wolfram Research}, title={DateBounds}, year={2020}, url={https://reference.wolfram.com/language/ref/DateBounds.html}, note=[Accessed: 12-June-2026]}