in reply to The function localtime(time) returns wrong month . How to overcome this problem ??
@month = qw(january february march april may june july august septembe +r october november december); $m = 1; print $month[$m]; # prints "february"
(No, I lied, actually the primary reason is backward compatibility with C. But I digress.)
So perhaps you can do this?
$m = 1; print +(1 .. 12)[$m]; # prints "2"
Now, it might be easier still, to just increment the month number.
$m++;
|
|---|