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.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to