where('create_time','> time','2016-1-1');
where('create_time','<= time','2016-1-1');
where('create_time','between time',['2015-1-1','2016-1-1']);
Db::table('think_user')->whereTime('birthday', '>=', '1970-10-1')->select();
Db::table('think_user')->whereTime('birthday', '<', '2000-10-1')->select();
Db::table('think_user')->whereTime('birthday', 'between', ['1970-10-1', '2000-10-1'])->select();
Db::table('think_user')->whereTime('birthday', 'not between', ['1970-10-1', '2000-10-1'])->select();
Db::table('think_blog') ->whereTime('create_time', 'today')->select();
Db::table('think_blog')->whereTime('create_time', 'yesterday')->select();
Db::table('think_blog')->whereTime('create_time', 'week')->select();
Db::table('think_blog')->whereTime('create_time', 'last week')->select();
Db::table('think_blog')->whereTime('create_time', 'month')->select();
Db::table('think_blog')->whereTime('create_time', 'last month')->select();
Db::table('think_blog')->whereTime('create_time', 'year')->select();
Db::table('think_blog')->whereTime('create_time', 'last year')->select();
Db::table('think_blog')->whereTime('create_time', 'd')->select();
Db::table('think_blog')->whereTime('create_time', 'w')->select();
Db::table('think_blog')->whereTime('create_time', 'm')->select();
Db::table('think_blog')->whereTime('create_time', 'y') ->select();
V5.0.5+版本开始,还可以使用下面的方式进行时间查询
Db::table('think_blog')->whereTime('create_time','-2 hours')->select();