Skip to content

Instantly share code, notes, and snippets.

@crmpicco
Created March 20, 2018 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crmpicco/7a8336bc0f171167856a3cb1fa042505 to your computer and use it in GitHub Desktop.
Save crmpicco/7a8336bc0f171167856a3cb1fa042505 to your computer and use it in GitHub Desktop.
Get Subscription Days Past Due
$subscriptionRenewalDate = \DateTime::createFromFormat('Y-m-d H:i:s', date('Y-m-d H:i:s', $subscription->currentTermEnd));
$now = new \DateTime('now');
$daysPastDue = $now->diff($subscriptionRenewalDate)->format('%a');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment