在mysql里面利用str_to_date()把字符串转换为日期
此处以表T_TGS_ALARMED的BJSJ为例,查询当前时间在此范围之内的数据。
insert into T_TGS_ALARMED (XH, HPZL, HPHM, BJSJ, BJLX, BJYY, KKID, DDBH, FXBH, CDBH, CLBJ, CJJG, CLRQ, CLRY, CLYJ, GXSJ, BZ)
values ('1603291112277032122172442', '01', '鲁N89728', STR_TO_DATE('29-03-2016 16:28:44', '%d-%m-%Y %H:%i:%s'), '8', '黄牌车辆在该路段上禁止行驶!', '201409021080', '201409021079', '02', 1, '0', '371400000000', null, null, null, STR_TO_DATE('29-03-2016 16:28:44', '%d-%m-%Y %H:%i:%s'), null);
注:'%Y-%m-%d %H:%i:%s'格式为:2016-03-11 16:52:30