I'm converting all of my dates from Y-m-d to m-d-Y with an extension (for the life of me I don't understand why this isn't a baked in option). The problem I'm running into is the product form is messing up my date available and added input (extension). When I save the form it saves all zeros to the database and then populates the form as some weird date like 11-30--0001 or 01-01-1970 which doesn't make any sense to me. I've tried adding the following codes right before the update database on the model product page but it doesn't work...gives me the same populated gibberish.
Code: Select all
$data['date_added'] = date('Y-m-d');
I tried this with the parameters reversed
Code: Select all
$data['date_added'] = date("Y-m-d", strtotime(str_replace("-","/",$data['date_added'])));
I tried this with the parameters reversed
Code: Select all
$data['date_added'] = date("Y-m-d", strtotime($data['date_added']));
I tried putting a msg box or print_r() within that function that is updating the database so I could see what is going on, but they don't seem to work within that function so I'm stuck.
Can someone show me why this isn't working?