I need to know whether the period defined by:
DateTime start;
DateTime end;
has a DST inside.
I am iterating over collection of periods defined by {start,end} and shifting start and end 24 hours forward in every iteration. The resulting period starts at midnight and ends at 1 ms before next midnight. I found that if the period has a daylight saving point inside the shift produces incorrect result, e.g:
having:
Duration targetDuration = new Duration(24*60*60*1000L-1);
DateTime start = new DateTime("2012-03-10T00:00:00.000-08:00");
DateTime end = new DateTime("2012-03-10T23:59:59.999-08:00");
then the shift is done:
start = end.plusMillis(1);
end = start.plus(targetDuration);
produces:
start = "2012-03-11T00:00:00.000-08:00"
end = "2012-03-12T00:59:59.999-07:00"
I wonder is there any standard API in JodaTime that can check whether the period of time has a DST inside?