Welcome Guest, Not a member yet? Register   Sign In
Date manipulate question
#11

[eluser]saidai jagan[/eluser]
I think u are not using result_array() in u r model, u r using result() thats y it is returning the object.
Or u can use like this
$article[0]->datetime=date('y-m-d',strtotime($article[0]->datetime));
#12

[eluser]Daniel_E9[/eluser]
Ahh I have managed to figure it out at last. I used the code below:

Code:
function index() {
            $this->load->model('article');
            $article = $this->article->get_article();
            
            $article_count = sizeof($article) -1;
            
            for ($i = 0; $i <= $article_count; $i++) {
                $article[$i]['article_date_time'] = date('d M y', strtotime($article[$i]['article_date_time']));
            }
        
            $this->parser->parse('blog', array('article' => $article));
        }

Thanks for your help again.
#13

[eluser]saidai jagan[/eluser]
otherwise u can use in hte query,
SELECT DATE_FORMAT('2009-10-04 22:23:00', '%W %M %Y');




Theme © iAndrew 2016 - Forum software by © MyBB