3
My problem is in the date conversion, see:
echo date('Y-m-d', strtotime(Input::get('data_evento')));
echo
of Input::get('data_evento')
: 14/02/2014
echo
of date('Y-m-d', strtotime(Input::get('data_evento')))
: 1969-12-31
I really don’t know what’s going on.
The field
data_evento
is being set? What values are coming from the form posting?– Rodrigo Rigotti
@rodrigorigotti is in doubt the value coming from the form is 14/02/2014 and to store in the bank would have to stay 2014-02-14
– Thiago Bueno
If it is coming as "14/02/2014", the
strtotime
will not understand the format and gives an invalid date (Unix time = -1, ie "31/12/1969"). What you can do is submit the date in YYYY-MM-DD format or change the date format after it was submitted.– Rodrigo Rigotti
From a read on: https://github.com/briannesbitt/Carbon great tool for date manipulation, everything you need one day is there. p. s: native
– juniorb2ss