📜  日期之间的碳月 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:10.485000             🧑  作者: Mango

代码示例1
$to = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', '2015-5-5 3:30:34');
$from = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', '2016-6-6 9:30:34');
$diff_in_months = $to->diffInMonths($from);
print_r($diff_in_months); // Output: 1