Skip to content

Instantly share code, notes, and snippets.

@caefer
Created August 30, 2011 14:36
Show Gist options
  • Select an option

  • Save caefer/1181038 to your computer and use it in GitHub Desktop.

Select an option

Save caefer/1181038 to your computer and use it in GitHub Desktop.
<?php
$from = new \DateTime('today');
$to = new \DateTime('tomorrow');
$in_range = array('$gte' => $from, '$lt' => $to);
$products = $dm->getRepository('MyBundle:Product')
->findBy(array('created_at' => $in_range));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment