in reply to Re: Simple Date Validation
in thread Simple Date Validation

not y10k compliant I'm afraid ;-)

Not Julian-compliant either!

You need to change

return 1 if $year < 1753

to

return 1 if $year < 1753 and not $year %4;

</nitpick>

Update: Memo to /me: Test before you post! (See below.)

Replies are listed 'Best First'.
Re^3: Simple Date Validation
by johngg (Canon) on May 11, 2007 at 17:43 UTC
    No, that's not necessary at all.

    By the time we reach that line in the subroutine we are only left with years that are divisible by 4 because of the line above, which is

    return 0 if $year % 4;

    so your amendment, and not $year %4, is superfluous.

    Cheers,

    JohnGG