BarPeriod = 1440;
BarOffset = 0; (default)

Therefore with every iteration of run(), hour() == 0.

See for yourself by
function run() {
printf("\n%d", hour());

To get that kind of fidelity, you have to use a finer BarPeriod.