Re: Set format for DATETIME in model

2010-06-14 Thread LunarDraco
Why do you care about the format of the data in the data array? The only time format of the date time should really matter is for display. And for display you should use the Time Helper in your views. It has many functions for presenting date time. And if you need to you can create your own class

Re: Set format for DATETIME in model

2010-06-13 Thread Jonas
I am on a cake v1.2 system so I don't think I have access to virtualFields...guess I have to get the [0] index and then use a helper to format the data... On Jun 11, 6:46 pm, calvin wrote: > You're going to have to use the virtualFields model property. > Otherwise, it will always place it under a

Re: Set format for DATETIME in model

2010-06-11 Thread calvin
You're going to have to use the virtualFields model property. Otherwise, it will always place it under a 0 index (even if you specify the virtual field in the find as 'Model.field'). Otherwise, just use a helper or the PHP date() function. On Jun 11, 7:29 am, John Andersen wrote: > As far as I un

Re: Set format for DATETIME in model

2010-06-11 Thread John Andersen
As far as I understand from the manual, then CONVERT means that you cast the date into another type, not converting the date into another format. Use DATE_FORMAT(date, format) instead! Enjoy, John On Jun 11, 4:26 pm, Jonas wrote: > What is the correct way of setting how I want the date return

Set format for DATETIME in model

2010-06-11 Thread Jonas
What is the correct way of setting how I want the date returned from a database Model->find ? Without anything set it returns [createdate] => Jun 11 2010 03:08:12:283PM which is not the format I'd like. If I modify the column name to i.e. convert(varchar(26), createdate, 126) as createdate I get