Thank you very much, that solved it! On Apr 13, 8:54 am, "Marcus T. Jaschen" <[EMAIL PROTECTED]> wrote: > EricS wrote: > > I have only spent a few weeks on cakephp but so far I love it. > > However, I have one issue I can't get past. I am having a really hard > > time getting dates formatted. I searched this group but wasn't able > > to get anything working. > > > Thedateis stored in the database as a datetime. I am trying to show > > the last 5 entries to the database sorted by the createddatedesc. I > > have the entries showing fine, in the correct order even. Thedateis > > in a datetime format and I would prefer just MM/DD/YYYY. > > > In my view I have the following > > > <?php echodate("m/d/Y", $nR['Restaurant']['created']); ?> > > > On the first record I get this error message: "Notice (8): A non well > > formed numeric value encountered [CORE\app\views\restaurants > > \index.ctp, line 16]" > > Use strtotime(): > > <?php echodate("m/d/Y", strtotime($nR['Restaurant']['created'])); ?> > > M.- Hide quoted text - > > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---