Carbon createFromFormat unexpected result
问题 ::createFromFormat() results in being one month ahead: var_dump($_GET['archive']); var_dump(Carbon::createFromFormat('m/Y', $_GET['archive'])); Result: string '11/2015' (length=7) object(Carbon\Carbon)[160] public 'date' => string '2015-12-01 10:38:41.000000' (length=26) public 'timezone_type' => int 3 public 'timezone' => string 'Europe/London' (length=13) 回答1: Seems that you just got unlucky because you were testing on the 31st of the month. However, this is (apparently) a documented