perldoc -f localtime . . . and $mon is the month itself, in the range 0..11 with 0 indicating January and 11 indicating December.