in reply to The function localtime(time) returns wrong month . How to overcome this problem ??

Months are numbered from 0 so you have to add 1. There is other strangeness in the output of that function so you better read its docs to avoid further confusion.

If you're doing a lot of work with dates you might want to have a look at the module Date::Manip, which is very handy and lets you avoid messing with localtime.

Steve

  • Comment on Re: The function localtime(time) returns wrong month . How to overcome this problem ??