Daniel Gardner wrote:

> Tuesday, June 18, 2002, 9:30:40 PM, Todd Wade wrote:
> 
>> # this sub was written by Larry Rosler
>> # modified by me to get rid of the 'argument isnt numeric' warnings by -w
>> # i found it on deja
> 
> it's probably better to use timelocal() from the core
> Time::Local module, if only for the reason that it's got a
> whole lot more documentation than this subroutine.
> 
Believe me I wanted to, but it takes dates that are out of range:

[trwww@misa trwww]$ perl -MTime::Local -e 
'print(timelocal(0,0,0,29,2,2002), "\n");'
1017378000

The sub I posted returns false.

The docs say it checks the range, but it just makes sure that $mday is <= 
31, no matter what month it is.

I didnt want to load a Date::* mod just to find out if a date was invalid 
in one place out of 2500 lines of code.

Todd W.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to