in reply to date and time

localtime outputs the month based at 0 for array lookups, so yes, adding 1 will ALWAYS give you the month number in human readable form. You cannot +1 the day, because the days go from 1-31, and on the 31st if you did +1 then it would show that tomorrow was the 32nd...

I would suggest you look into POSIX::strftime and also the modules Date::Manip and Date::Calc

                - Ant
                - Some of my best work - Fish Dinner

Replies are listed 'Best First'.
Re: Re: date and time
by arabella (Acolyte) on Oct 16, 2001 at 06:57 UTC
    The 'strangeness' comes directly from the tm struct the unix routines localtime(2) and gmtime(2) use.
    Your comment about array lookups is right on. The day-of-the-week (localtime[6]) also starts at zero to facilitate lookup.