Hi,

As per the $status array structure, you should use $status[0][0]['time']

Hope this helps.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Wed, Jan 19, 2011 at 12:24 PM, ojonam <[email protected]> wrote:

> Hi,
>
> I have a model Status with fields 'name', 'time', of which 'time' is a
> timestamp. I perform a find query and try to cast timestamp as date:
>
> $status = $this->Status->find('all', array('fields' => array('CAST
> (Status.time AS DATE) time')));
>
> debug($status) gives me :
>
> Array
> (
>    [0] => Array
>        (
>            [Status] => Array
>                (
>                    [name] => AF1234
>                )
>
>            [0] => Array
>                (
>                    [time] => 2010-12-02 15:05:11
>                )
>
>        )
>
> )
>
> How do I retrieve the time data from the array? $status[0]['time']
> does not work.
>
> Thanks,
> ojonam
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to