Last active
February 11, 2022 18:07
-
-
Save anaxamaxan/513f7cdb68738310dec4be12d248a33b to your computer and use it in GitHub Desktop.
Carbon gotcha
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Carbon\Carbon; | |
Carbon::now()->addDays(365)->diffInDays(Carbon::now()); | |
// 364 | |
Carbon::now()->addDays(365)->diffInDays(Carbon::now()->subSecond()); | |
// 365 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment