Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nomadme's avatar

Create carbon object from PGSQL date type

I have a pgsql date type that I want to convert to Carbon object.

How do I convert this to Carbon object? From the documentation I found passing the value as a second parameter would give me a object with default time. But, I guess I'm missing something.

$date = "2016-04-19";
$carbonDate = Carbon::createFromFormat('y-m-d',  $date);
0 likes
1 reply

Please or to participate in this conversation.