Different Date Format In Form And Db

In all my web applications my users selects/enters dates in the format ‘d.m.Y’, and I convert all dates to format ‘Y-m-d’ when storing to database.

This job creates a bit of hassle, especially when user submits a form, I convert the date to DB format, and the form is invalid, and I have to convert the date back to the users format.

I wonder if there is any build-in handling for these situations in Yii?


afterfind and beforesave are both methods we have to handle… for my knowledge. i hope this is a optimist solution

Seems like that is the solution today. Thanks! :)