I would like to implement a small time container that holds 2 times, a start and an end,
, i wanna use it iterating it over events on multiple days in order to check if an event has occurred in that specific timeframe, i will have to work only on a minute/range, so the object would look like something lie this `
timeContainer(hour-minutes start, hour-minutes end);
the timeframe will be usually a range of few minutes, like 13:00pm to 13:10pm
The issue i’m having is with the milliseconds, since they represent a static final moment, they cannot be used for iteration over multiple days, i would use it as, pseudocode:
select events that has happened in the timeframe specified in the constructor regardless of the day and month,
the events contain a Calendar instance, and i would like to perform a match against the hours and minutes, any advice?
I’m trying to rech thsi with joda-time but so far no method found
Thank you
If you’d want to do it with milliseconds, just use the mod (%) with the number of milliseconds in a day. If you want to go with Joda-time you’ll probably get something more readable. See examples below.