in reply to month off by one?
I think perldoc -f localtime might be helpful here. The month returned from localtime comes from a 0-based array. Therefore, 0 = January, 1 = February, etc.