DATE_FORMAT in CodeIgniter

0

The date_format() function returns a date formatted according to the specified format.

Let’s create a date_format() in where condition using codeigniter.

if(!empty($this->input->get('start_date')))
{
	$this->db->where('DATE_FORMAT(products.created_datetime,"%Y-%m-%d") >=',
		date('Y-m-d',strtotime($this->input->get('start_date'))));
}