title: Date Mongodb with Node y Express
body: <p>I have an api with node, express and mongodb</p>
  
  <h1>Save</h1>
  
  <pre><code>function SaveOfferDay(req, res){
      var update = req.body;
      var id = req.params.id;
  
      Offer.update(   {"_id": id},{"$addToSet": {"date": {"day" : new Date("2018-
                  12-04"),}}}, (err, offerUpdated) =&gt; {
          if(err) return res.status(500).send({message: 'Error en la petición'});
          return res.status(200).send({offer: offerUpdated});
  
      });
  }
  </code></pre>
  
  <p>2018-12-04T00:00:00.000Z</p>
  
  <p>and I want the date to be</p>
  
  <p>2018-12-04T23:00:00.000Z</p>
  
  <p>NOW I want to make a query, where I show all the results after this date.</p>
  
  <h1>
  query</h1>
  
  <pre><code>function getOffer(req, res){
      var cityId = req.params.city;
      var hoy = new Date();
  
  
  
      if(req.params.page){
          var page = req.params.page;
      }else{
          var page = 1;
      }
  
      var itemsPerPage = 4;
  
      Offer.find({city:cityId,'date.day' : {"$gte" :'2018-12-05' }
      }).sort('name').paginate(page, itemsPerPage, function(err, offers,
      total){
          if(err){
              res.status(500).send({message: 'Error en la petición.'});
          }else{
              if(!offers){
                  res.status(404).send({message: 'No existe!! !!'});
              }else{
  
                  return res.status(200).send({
                      total_items: total,
                      offers: offers
                  });
              }
  
          }
      });
  }
  </code></pre>
  
  <p><strong>Here is the question</strong></p>
  
  <p>When I make a query and I want you to return the records for that day, they are not found. I've been looking and the problem is the time at which the record is saved.</p>
  
  <p>Let's see if anyone can understand me what I mean</p>