To begin with, it's extremely unlikely. Namely, that the loop starts at 23:59:58 and the loop takes so long so that when the n+1 element is unpacked it's now a new day. 
But I see your point. It's a wart that it *could* happen and it'd be better that it's set once for when the app starts its work.