本文共 364 字,大约阅读时间需要 1 分钟。
时间存放到mongo需要转换
$v3 = '2014-08-05';$date = new \MongoDate(strtotime($v3);$product['created_at' ]= $date;
取出:
if($date->sec){ $v6 = date('Y-m-d H:i:s', $v6->sec);}
查询:
$start = new MongoDate(strtotime(’1971-01-01 00:00:00′));$end = new MongoDate(strtotime(’1999-12-31 23:59:59′));$collection->find(array(“create_date” => array(‘$gt’ => $start, ‘$lte’ => $end)));
转载地址:http://fydli.baihongyu.com/