[EMAIL PROTECTED] wrote:
------------------------------------------------Excellent! that works and your rite the Today function is not exported automagically
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 compareThese need to be Now() and Today() (note uppercase first char)
the following works and returns the expected daysYou may need:
##############################################
# use strict ;
-w ;
use Date::Calc qw( Date_to_Days ) ;
use Date::Calc qw ( Date_to_Days Today );
But only if Today is not exported automagically.
Undefined subroutine &main::Today called at adate2.pl line 25.
use Date::Calc qw ( Date_to_Days Today );
once I call it as above the assign as below it give me the vairable of todays date
$daydiff = Date_to_Days(Today()) - Date_to_Days($year1,$month1,$day1);
Thanks.!!
rob
my $year1, $year2 , $month1 ,$month2 ,$day1 , $day2 ,$daydiff ;Can then be written:
$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)) ;
$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
-- Well, I think Perl should run faster than C. :-) -- Larry Wall in <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]