James
0
Q:

how to get date difference in codeigniter

$this->db->where('sell_date BETWEEN "'. date('Y-m-d', strtotime($start_date)). '" and "'. date('Y-m-d', strtotime($end_date)).'"');
0
$date1 = date("Y-m-d",strtotime($_POST['customer_birth']));
$date2 = date("Y-m-d",strtotime($_POST['customer_marriage']));

$diff = abs(strtotime($date2) - strtotime($date1));

$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
0

New to Communities?

Join the community