I am on version 12.3.1 (MS Windows) and I want to get the date bounds of a date interval of a few months (let's say October and November), but the max bound is wrong. I tried
DateBounds[DateInterval[{{{2021, 10}, {2021, 11}}}]]
but it gives me . I want exact bounds with granularity of seconds, so I tried
DateBounds[DateInterval[{{{2021, 10}, {2021, 11}}}], "Second"]
but it gives me: . This is obviously wrong, because it does not include November. I expect to get: .
Mathematica clearly understands that November is included in the DateInterval, because both IntervalMemberQ
and TimelinePlot
work fine:
TimelinePlot[DateInterval[{{{2021, 10}, {2021, 11}}}]]
IntervalMemberQ[DateInterval[{{{2021, 10}, {2021, 11}}}], DateObject[{2021, 11, 15, 0, 0, 0}]]
How can I get the full date range with granularity of seconds?
This is a workaround I came up with so far, but I do not like it much:
MinMax[Map[DateInterval[#, "Second"] &, DateBounds[DateInterval[{{{2021, 10}, {2021, 11}}}]]]]