Created
June 1, 2017 13:07
-
-
Save microdesign/6cbb930b3a5cb301df5acd00cceca113 to your computer and use it in GitHub Desktop.
Next delivery date
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
$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