fixed date check for PHP version 5.2