in reply to Error from timelocal

Edit: Oopsie, I see MarkM has already mentioned this. I must have missed that portion of his reply.

This is just a wild guess, but seeing as it is December, make sure $month is zero-based (January is 0, December is 11). timelocal() does out-of-range checking, and will not accept 12 as a month.

Replies are listed 'Best First'.
Re: Error from timelocal
by thezip (Vicar) on Dec 21, 2002 at 03:29 UTC
    Yes, since its December, you're probably using 12 which is out-of range for $month. You may also need to subtract 1900 from the year since it (currently) needs to be 102. Try dumping the values from localtime so that you can see what the values should look like, as in:
    use strict; use Data::Dumper; my @time_ary = localtime(time); print Dumper(\@time_ary);
    Where do you want *them* to go today?
      You may also need to subtract 1900 from the year since it (currently) needs to be 102.
      Time::Local is smart enough to figure that out by itself.