Created
February 28, 2017 13:37
-
-
Save mklasen/27eb016a74460171b84b0803ddbb77ff to your computer and use it in GitHub Desktop.
Compare between dates in PHP
This file contains hidden or 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
$today = new Datetime(); | |
$min = DateTime::createFromFormat('d/m/Y', '25/02/2017'); | |
$max = DateTime::createFromFormat('d/m/Y', '03/03/2017'); | |
if ($min->getTimestamp() <= $today->getTimestamp() && $max->getTimestamp() >= $today->getTimestamp()) { | |
// | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment