 <p>You can use <strong><a href="http://php.net/manual/en/function.mktime.php" rel="nofollow">mktime()</a></strong> or <strong><a href="http://php.net/manual/en/function.strtotime.php" rel="nofollow">strtotime()</a></strong></p> <pre><code>$input_time = mktime(0,0,0,$_POST['m']+1,0,$_POST['y']); if ($input_time &lt; time()){ print '&lt;p class = "error"&gt;Date has elapsed&lt;/p&gt;'; } </code></pre>