php - mysql utcdate string comparison codeignitor -


in codeignitor have mysql database date column in format

mon, 12 sep 2017 13:54:04 gmt .

i want records last 1 year i.e period mon, 12 sep 2016 13:54:04 gmt til now. trying form clause cant figure out how compare 2 utcdate strings.

i tried using $this->db->where('date(created) >=',$_post['duration']); doesn't work. values in created column in above format.

str_to_date(substr("mon, 14 aug 2017 13:54:04 gmt",1,25), "%a, %d %b %y %h:%i:%s"). else searchingn samething. riggsfolly helped me answer.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -