Search code examples
timezonejodatimedst

joda overlap method for ambiguous hour


I'm trying to find out if there is any overlap between two joda intervals. value of the variables are given below. I'm not sure why the overlap is being returned as 'null'.

final Interval overlap = range.overlap(new Interval(beginDateTime, endDateTime));

beginDateTime = 2013-11-03T00:07:00.000Z
endDateTime = 2013-11-03T00:08:00.000Z
range = 2013-11-03T00:00:00.000-05:00/2013-11-03T23:59:59.999-06:00

Interval created by 'beginDateTime' and 'endDateTime' corresponds to ambiguous hour in America/Chicago time zone. Variable 'range' represents November 3rd in America/Chicago time zone.

I tried to debug into Interval.class, could not find out the reason.

thanks.


Solution

  • Never mind, found the issue.

    beginDateTime and endDateTime be 2013-11-03T07:00:00.000Z and 2013-11-03T08:00:00.000Z respectively.

    My test data was incorrect as listed in the question (that is not ambiguous hour, it is interval of just 1 minute, I swapped minutes with hour values) :)