Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save microdesign/6cbb930b3a5cb301df5acd00cceca113 to your computer and use it in GitHub Desktop.
Save microdesign/6cbb930b3a5cb301df5acd00cceca113 to your computer and use it in GitHub Desktop.
Next delivery date
$now = strtotime(date("Y-m-d 00:00:01"));
$nextFriday = strtotime('next friday midnight');
$difff = $nextFriday - $now;
$diff = floor($difff / (60 * 60 * 24));
$daysLeft = ($diff == 1) ? $diff.' day' : $diff.' days';
echo 'Next delivery will be on Friday, '.date('d.m.Y', $nextFriday).'. '.$daysLeft.' left till delivery.';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment