------------------------------------------------ On Thu, 05 Dec 2002 09:53:14 -0600, rob <[EMAIL PROTECTED]> wrote:
> Hello All Ive been away from this list for a while and am very rusty... > I need to know how to pass now(); or today(); to my date compare These need to be Now() and Today() (note uppercase first char) > > the following works and returns the expected days > ############################################## > # use strict ; > -w ; > > use Date::Calc qw( Date_to_Days ) ; You may need: use Date::Calc qw ( Date_to_Days Today ); But only if Today is not exported automagically. > > my $year1, $year2 , $month1 ,$month2 ,$day1 , $day2 ,$daydiff ; > > $year1 = 1990 ; > $month1 = 3 ; > $day1 = 6 ; > > $year2 = 2002 ; > $month2 = 12 ; > $day2 = 11 ; > > > $daydiff = Date_to_Days($year2,$month2,$day2) - > (Date_to_Days($year1,$month1,$day1)) ; Can then be written: $daydiff = Date_to_Days(Today()) - Date_to_Days($year1,$month1,$day1); This is untested, sorry don't have access to my normal Date::Calc world :-), so buyer beware.... http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]