Do not format the date when you are retrieving it from the database. Format the date when you are presenting it to the user in a view. Use the Time helper for this! Enjoy, John
On Jan 13, 4:27 pm, codef0rmer <[email protected]> wrote: > It already ate my 1+ hour to figure out the problem. I hope, i'll get > a help here... > > User Table Structure: > id > gender_salutation_id > first_name > middle_name > last_name > dob > email > > GenderSalutation table Structure: > id > name > > I used below code to fetch the full name and formatted dob: > $arrUser = $this->User->find("first", array( > "conditions" => array("User.email" => > $this->Session->read > ("email")), > "fields" => array( > "GenderSalutation.name", "User.first_name", > "User.middle_name", > "User.last_name", "DATE_FORMAT(User.created, '%d') AS created", > "User.dob", > ), > )); > > which returns: > Array > ( > [GenderSalutation] => Array > ( > [name] => Mr. > ) > > [User] => Array > ( > [first_name] => foo > [middle_name] => bar > [last_name] => foo > [dob] => 1985-10-29 19:13:29 > ) > > [0] => Array > ( > [created] => 13 > ) > > ) > > I want [created] => 13 in [User] key. > What do i do? please help...
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" 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
