Question: how to find difference between two dates in codeigniter?
Answer: 3 Answers. Adjust the date format to the format you are using. $leave_start = '01-01-2018'; $leave_end = '10-01-2018'; $id = 1; $diffDays = abs($leave_end - $leave_start); $this->db->set('leave_days', $diffDays); $this->db->where('id', $id); $this->db->update('leave');