Hello,
I'm trying to update a finder to only return users with a ban date of within the last 24 or 72 hours
Looking at other code this seems to work to find for the current day, but is this the right kind of thing to use to find for the current day, but can this easily be adjusted to last 24 or 72 hours?
I'm trying to update a finder to only return users with a ban date of within the last 24 or 72 hours
Code:
$users = $finder
->with('Ban')
->where('is_banned',1)
->where('message_count','>',100)
->order('Ban.ban_date','DESC')
->limit($limit)
->fetch();
Looking at other code this seems to work to find for the current day, but is this the right kind of thing to use to find for the current day, but can this easily be adjusted to last 24 or 72 hours?
Code:
$date = new \DateTime("now", new \DateTimeZone($visitor['timezone']));
$date->setTime(0, 0, 0);
$start = $date->getTimestamp();