Example:
<?
$date1 = date("Y/m/d");
$date2 = date("Y/m/d");
echo datediff($date1, date2);
function datediff($sdate,$edate){
$rs = $this->execute("select to_days('$edate') - to_days('$sdate') as diff");
if($row = $this->row($rs)){
return $row["diff"];
}else{
return "0";
}
}
?>
No comments:
Post a Comment