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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -