You might also look at the Time helper some great functions there http://manual.cakephp.org/chapter/helpers
and in the api http://api.cakephp.org/class_time_helper.html HTH Sam D On 4/13/07, 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. > > > > The date is stored in the database as a datetime. I am trying to show > > the last 5 entries to the database sorted by the created date desc. I > > have the entries showing fine, in the correct order even. The date is > > in a datetime format and I would prefer just MM/DD/YYYY. > > > > In my view I have the following > > > > <?php echo date("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 echo date("m/d/Y", strtotime($nR['Restaurant']['created'])); ?> > > M. > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---