Skip to content

Instantly share code, notes, and snippets.

@anaxamaxan
Last active February 11, 2022 18:07
Show Gist options
  • Save anaxamaxan/513f7cdb68738310dec4be12d248a33b to your computer and use it in GitHub Desktop.
Save anaxamaxan/513f7cdb68738310dec4be12d248a33b to your computer and use it in GitHub Desktop.
Carbon gotcha
<?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