SELECT * FROM (`tabl1` as ap)
WHERE (ap.fromdate BETWEEN "2015-11-20 11:00:00" AND "2015-11-20 12:00:00")
AND (date('Y-m-d H:i:s',strtotime(ap.fromdate)+3600)
BETWEEN "2015-11-20 11:00:00" AND "2015-11-20 12:00:00")
答案 0 :(得分:1)
使用DATE_ADD
或INTERVAL
DATE_ADD(NOW(), INTERVAL 1 HOUR)
或
NOW() + INTERVAL 1 HOUR
如果您的日期时间名称为ap.fromdate
,请使用此选项: -
ap.fromdate + INTERVAL 1 HOUR