Level 80
@mojtabaavahdati The parse() method tries to “guess” the format of the date you provide. You should use createFromFormat() if you know the format of the date you’re passing, and specify it:
// tries to guess date
$date = Carbon::parse('9 July 2018');
// specifying the format the date is in
$date = Carbon::createFromFormat('Y-m-d', '2018-07-09');
3 likes