Welcome Guest, Not a member yet? Register   Sign In
date format
#1

[eluser]Michal1[/eluser]
Hey guys,

I am inserting a selected data from a jquery date picker into database field and I have a little problem with that.

In my view I have:

Code:
[removed]
$(function(){
$("#date_from").datepicker({dateFormat: 'dd-mm-yy'});

});

[removed]

Then in site controller I have a function for adding data into array and a line

Code:
'date_from'=>$this->input->post('date_from'),

Then in model I of course insert it into database into 'date_from' field which has a type "date". The problem is that as you can see I set format of date_from in my view to: dd mm yy while my field in database is automatically set to yyyy mm dd. And I dont know how to change that field in database to my view format?

Thank you




Theme © iAndrew 2016 - Forum software by © MyBB