说明不清且执行结果是错的
此投稿已在 5年前 合并。
内容修改:
| Old | New | Differences |
|---|---|---|
| 235 | 235 | $dt = Carbon::now(); |
| 236 | 236 | |
| 237 | 237 | $dt = $dt->subHours(6); |
| 238 | echo $dt->diffInHours($current | |
| 239 | echo $current->diffInHours($dt | |
| 238 | echo $dt->diffInHours($current, false); // 6,相当于 $current-$dt,这里的false表示结果不取绝对值,默认是值是true | |
| 239 | echo $current->diffInHours($dt, false); // -6,相当于 $dt-$current | |
| 240 | 240 | |
| 241 | 241 | $future = $current->addMonth(); |
| 242 | 242 | $past = $current->subMonths(2); |
关于 LearnKu