in reply to convert month number to month name

Have you considered using strftime() from the POSIX module? The parameters to strftime() can be found here: http://linux.die.net/man/3/strftime