Date format - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Date format (/showthread.php?tid=43184) |
Date format - El Forum - 07-03-2011 [eluser]Perkin5[/eluser] I'm a beginner developing a blog. It all gone quite well except the MySQL date output is in the form 2011-06-01 and I want it to be in the form 01 June 2011. I've had a look through the data helper guide but can't see how to convert the format from there. I'm thinking that it has to be in the database read function which at the moment looks like this: Code: $query = $this->db->get('blog'); Can anyone advise me how to pull it off? Date format - El Forum - 07-04-2011 [eluser]toopay[/eluser] Just assign the new date format to the result data... Code: // Suppose you have this in your model Date format - El Forum - 07-04-2011 [eluser]Perkin5[/eluser] SOLVED. Thank you so much for that - works a treat! Date format - El Forum - 07-04-2011 [eluser]InsiteFX[/eluser] If you need to get and rearrange parts of a date there is an easy way to do it! PHP getdate InsiteFX Date format - El Forum - 07-05-2011 [eluser]Perkin5[/eluser] Very useful additional information - many thanks for that! |