php - Symfony date variable if statement -


i have 2 variables being set this:

      <?php $current = strftime('%m/%d/%g %h:%m:%s')?>       <?php $target = strftime('%m/%d/%g %h:%m:%s', strtotime($item->getendtime()))?> 

then have if statement this:

      <?php if ($current < $target): ?>                <?php else: ?>                <?php endif; ?> 

it works fine until in new year. example, have few items have "endtime" in 2012. if if statement works should, should "do that" instead it's doing "do this"

use below instead (compare unix timestamp):

$current = time(); $target = strtotime($item->getendtime()); 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -