getTimeStamp(); $d2=new DateTime($T2); $d4 = $d2->getTimeStamp(); $server = "mongodb://localhost:27017"; $conn = new Mongo($server); $db = $conn->selectDB('WirelessAp'); echo "Database WirelessAP selected"; $collection = new MongoCollection($db, 'coldata2'); var_dump(coldata2); $data = array('timestamp' => array('$gt' => $d3,'$lt' => $d4)); echo '
'; 
  $data = json_encode($data);
 
   var_dump($data);
  $cursor = $collection->find([$data]);
  print_r($cursor);
  foreach ($cursor as $doc) {
  var_dump($doc);
}
?>