CodeIgniter Forums
Trying to create condition with dates. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: Trying to create condition with dates. (/showthread.php?tid=77937)



Trying to create condition with dates. - MrsSnipe - 11-06-2020

So I'm trying to figure out:
how do I create a condition for a partial to show until a certain date arrives? i.e. if date < 12-21-2020 

Can someone help me with figuring out this condition? Let me know what other information I should provide. 

Thanks,


RE: Trying to create condition with dates. - InsiteFX - 11-07-2020

Something like below, not tested.

PHP Code:
$today date("m-d-Y");
$date  '10-10-2020';

if (
$today $date)
{
    // true
}
else
{
    // false


SEE:

php.net - date