3 Replies Latest reply: Apr 5, 2013 1:50 AM by Sudarshan Thiagarajan RSS

    PHP show if datetime hasn't passed

    matthew stuart Community Member

      I am trying to have a region stay visible until a deadline has passed, and I have this code, but it's not working!

       

      if (strtotime($row_WADAtbl_vacanciesPOSTED['fld_vLOCKDATE']) <= mktime(0,0,0)){

       

      I've also tried:

       

      if (strtotime($row_WADAtbl_vacanciesPOSTED['fld_vLOCKDATE']) <= $curdate['NOW()']){

       

      In both instances, if I use <= then the region disappears regardless of the time and date having expired or not, if I use >= then they display regardless of the date and time.

       

      What am I doing wrong here?

       

      Thanks in advance... again!