Skip to content

Instantly share code, notes, and snippets.

@Matan
Created July 21, 2011 09:04
Show Gist options
  • Save Matan/1096820 to your computer and use it in GitHub Desktop.
Save Matan/1096820 to your computer and use it in GitHub Desktop.
PHP function to check whether a date has passed or not
//Sample use
isBeforeDate("1988-01-04"); //false - My birthday, it's long gone!
isBeforeDate("3000-06-29"); //true - This is when the robots will take over ;-)
function isBeforeDate($timestamp)
{
$timestamp = intval(strtotime($timestamp));
return ($timestamp > time());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment