logo       

[symfony-users] Propel, compare the day, not the timestamp: msg#00892

symfony-users

Subject: [symfony-users] Propel, compare the day, not the timestamp


Hi,

What I want to do is to compare if a date field is today. I have
written that:

$c = new Criteria();

$today = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$tom = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y'));

$criterion = $c->getNewCriterion(self::END_AT, $today,
Criteria::GREATER_THAN);
$criterion->addAnd($c->getNewCriterion(self::END_AT, $tom,
Criteria::LESS_THAN));
$c->add($criterion);


It works fine but it looks rubbish! Is there a way to write that in
one line?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to symfony-users@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
symfony-users+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise