tatthien
2 years ago
1361
3
Laravel

Convert month name to number with Carbon

Posted 2 years ago by tatthien

Hi,

I got a problem with Carbon::parse().

I parse April but get 5.

Here is the result in tinker

>>> Carbon\Carbon::parse('April')
=> Carbon\Carbon {#767
     +"date": "2017-05-01 00:00:00.000000",
     +"timezone_type": 3,
     +"timezone": "UTC",
   }
>>>

Please sign in or create an account to participate in this conversation.