laravel - Can't format datetime in carbon -
when try format $date
d/m/y
it's work fine
$date = '20/4/2015'; carbon::createfromformat('d/m/y', $date)
but when try format $date
d/m/y
$date = '20/4/2015'; carbon::createfromformat('d/m/y', $date)
i got error following,
the separation symbol not found trailing data
what wrong in code?
m means textual representation of month. 4 cannot parset month , fails though strange message. try , works
$date = '20/jan/2015'; $carbdate=carbon::createfromformat('d/m/y', $date); dd($carbdate);
outputs
carbon {#260 ▼ +"date": "2015-01-20 10:01:01" +"timezone_type": 3 +"timezone": "utc" }
Comments
Post a Comment