Fix bug for publishing on the same day

time was not being calculated