Location: PHPKode > projects > Network Asset Management Archive > nama/datediff.inc
<?

Function DateDiff ($interval, $date1,$date2) {

    // get the number of seconds between the two dates
$timedifference =  $date2 - $date1;
    
    switch ($interval) {
        case "w":
            $retval  = $timedifference / 604800;
            break;
        case "d":
            $retval  = $timedifference/86400;
            break;
        case "h":
             $retval = $timedifference/3600;
            break;        
        case "n":
            $retval  = $timedifference/60;
            break;        
        case "s":
            $retval  = $timedifference;
            break;        

    }    
    return $retval;
    
}
?>



Return current item: Network Asset Management Archive