aWebDeveloper
aWebDeveloper

Reputation: 38422

cakephp form/date helpers

I have 3 dropdwons for day month and year. I was combining them till recently to save date_of_inspection in the db in mysql format. I was using the Day, month and year cakephp form helpers.This is what i was doing

$this->data['Cabinet']['date_of_inspection'] =
    $this->data['Cabinet']['date_of_inspection']['year'].'-'.
    $this->data['Cabinet']['date_of_inspection']['month'].'-'.
    $this->data['Cabinet']['date_of_inspection']['day'];

I removed the above line and still the date was being stored in mysql date format. How come ?? Does cakephp do it.

Upvotes: 1

Views: 599

Answers (1)

deceze
deceze

Reputation: 522606

In short, yes. Date and time "subarrays" are automatically deconstructed as part of the save process.

Upvotes: 1

Related Questions