wordpress - PHP Include based on date -


trying change includes based on specific date. work:

if (date('m/d/y') < date('m/d/y', strtotime("01/10/2011"))) {     //display } else if (date ('m/d/y') >= date('m/d/y', strtotime("01/10/2011")) && date ('m/d/y') <= date("m/d/y', strtotime("05/10/2011"))                // display else else {     //display different } 

if understanding strtotime function correctly, figure work. not sure understanding correctly. let me know!

date returns string 2011-01-26, can't compare string 2011-02-23 useful result. need compare timestamps produced strtotime or time:

if (time() /* (now) */ < strtotime('2011-01-26')) ... 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

sql server - python to mssql encoding problem -

windows - Python Service Installation - "Could not find PythonClass entry" -