The problem is actually somewhere else to start with. The historical backfilling datetime strings are currently being returned in localtime format and there is where you may have seen the gap (due to discrepancies in the price because some hours have elapsed). The code doesn't know it is in localtime and that's why times perfectly align later.
Looking at the output of the original testing, documented in the blog, there were no gaps in the prices.
Switching to using unix timestamps is not straightforward, because the the most up to date API documentation from
IB (the one at GitHub) states that the
1 day bars can only request strings for the datetime timestamps.