How about: if($time1 > $time2){ $difference = $time1 - $time2; }else{ die "Invalid date!\n"; }
-----Original Message----- From: Werner Otto [mailto:[EMAIL PROTECTED] Sent: Fri 6/18/2004 5:34 AM To: Tim Johnson; [EMAIL PROTECTED] Cc: Subject: Re: Subtracting Zero Dates they are all ready in time format, that is the problem. Example: $time1 = Date_to_Time($year,$month,$day, $hour,$min,$sec); $time2 = Date_to_Time($year,$month,$day, $hour,$min,$sec); $difference = $time1 - $time2; > One way: Convert both dates to Perl time() format, then subtract. > > -----Original Message----- > From: Werner Otto [mailto:[EMAIL PROTECTED] > Sent: Fri 6/18/2004 3:28 AM > To: [EMAIL PROTECTED] > Cc: > Subject: Subtracting Zero Dates > > > > Hi All, > > Does anyone know how to handle subtracting two dates where one might be > 0 > or no time or blank? > > > -- Kind Regards, Werner Otto Web/Programming Support Department of Computer Science Kings College