in reply to built-in gmtime() returning one month off?

The localtime and gmtime functions represent the month of the year as a digit between 0 and 11 (0 = January etc...). Add one to your month value to get the result you are looking for.
($day,$month,$year)=(gmtime)[3,4,5]; printf"02d-%02d-%04d",$month+1,$day,$year+1900;
-Jason

Replies are listed 'Best First'.
Re: Re: built-in gmtime() returning one month off?
by snafu (Chaplain) on Jun 18, 2002 at 19:10 UTC
    Bah!! Somebody kick me please! :) Thanks to all. *sigh*

    _ _ _ _ _ _ _ _ _ _
    - Jim
    Insert clever comment here...

      Bah!! Somebody kick me please! :) Thanks to all. *sigh*

      /me kicks snafu :)
      Next time, RTFM first. On your local system, you can use perldoc -f gmtime to get the appropriate documentation. Don't code by trial-and-error. Always have a terminal open to access documentation :)

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.