thursiv has asked for the wisdom of the Perl Monks concerning the following question:

My users can enter a launching date and an expiration date. I have used a validation for the format of the dates, but I'm afraid I dont know how to stop the user from entering an expiration date that is ealier in real time than the launching date, or launching date later than the expiration date.

Replies are listed 'Best First'.
Re: date validation
by arturo (Vicar) on May 10, 2001 at 18:05 UTC

    Check out Time::Local, which given month, date, and year will return UNIX epoch timestamps, which can be directly compared with normal arithmetic operators. If you need more powerful date manipulation than that, check out Date::Calc or Date::Manip (this one's huge and beastly, but I think it's neat)

    HTH.

    perl -e 'print "How sweet does a rose smell? "; chomp $n = <STDIN>; $r +ose = "smells sweet to degree $n"; *other_name = *rose; print "$other +_name\n"'
Re: date validation
by buckaduck (Chaplain) on May 10, 2001 at 19:58 UTC
Re: date validation
by AidanLee (Chaplain) on May 10, 2001 at 18:07 UTC

    I believe Date::Manip on cpan might have this kind of functionality

    IMHO, the easiest way to do such a thing outside of a CPAN module would be to convert the dates to seconds since the epoc and compare the two numbers.