[EMAIL PROTECTED] wrote:

------------------------------------------------
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.

Excellent! that works and your rite the Today function 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 ;

$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



--
 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]

Reply via email to