time: fix horrible month arithmetic