note 39475 deleted from function.time by aidan
| From: | aidan@php.net | Date: | Sat, 08 Oct 2005 01:06:33 +0000 |
| Subject: | note 39475 deleted from function.time by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96635@lists.php.net to get a copy of this message | ||
Note Submitter: pting1 at yahoo
----
In the CalcDateDiff function below, instead of using:
if( $date2 > $date1 )
{
die( "error: date1 has to be >= date2 in calcDateDiff($date1, $date2)" );
}
$diff = $date1-$date2;
Simply use this to avoid having to handle errors:
$diff = abs($date1-$date2);