博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mongodb 时间操作
阅读量:4199 次
发布时间:2019-05-26

本文共 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/

你可能感兴趣的文章
MFC 消息映射的工作方式
查看>>
MFC项目Unicode版本程序入口
查看>>
精典FormsAuthenticationTicket分析
查看>>
asp.net form验证
查看>>
VS2008中安装ASP.NET MVC2后无法新建工程的解决方法
查看>>
SQL Server 标识列
查看>>
SQL WITH TIES
查看>>
ASP.NET调用存储过程并接收存储过程返回值
查看>>
Debian: Driver 'pcspkr' is already registered, aborting
查看>>
Samba
查看>>
JavaScript原型和继承
查看>>
passdb backend = tdbsam
查看>>
Samba配置文件常用参数
查看>>
debian安装mongodb
查看>>
2020-10-20
查看>>
易购考拉The first day
查看>>
易购考拉 The second day
查看>>
易购考拉 On the third day
查看>>
易购考拉 The fourth day
查看>>
易购考拉 The fifth day
查看>>