develooper Front page | perl.beginners | Postings from December 2002

simple date compare need to do now(); on Date:Calc

Thread Next
From:
rob
Date:
December 5, 2002 06:53
Subject:
simple date compare need to do now(); on Date:Calc
Message ID:
3DEF766A.6010907@attbi.com
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

the following works and returns the expected days
##############################################
# use strict ;
-w ;

use Date::Calc qw( Date_to_Days ) ;

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)) ;

print "$daydiff\n" ;
###############################################

however $year2, $month2, $day2 variables need to be the current date.....

I cant make heads or tails of the doc page
http://www.engelschall.com/~sb/download/Date-Calc/

this must be too obivious of a question... please bear with me

your help is appreciated

thanks
rob

-- 
  Civilization is the process of reducing the infinite to the finite.  



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About