数据库中存的时间戳,如何进行各种时间间隔计算,直接上SQL语句
select
b.demandId
from dj_api_designer_demandbid b
left join dj_api_user_customizeddemand c on b.demandId = c.demandId
where b.designerId = '37'
and (b.bidWorksUrl = '' || b.bidWorksUrl = null)
and FROM_UNIXTIME(unix_timestamp()) <![CDATA[ > ]]> DATE_ADD(FROM_UNIXTIME(c.bidEndDate), INTERVAL c.deliverDays DAY)
and FROM_UNIXTIME(unix_timestamp()) <![CDATA[ < ]]> DATE_ADD(DATE_ADD(FROM_UNIXTIME(c.bidEndDate), INTERVAL c.deliverDays DAY), INTERVAL 7 DAY)
FROM_UNIXTIME:将MYSQL中以INT(11)存储的时间以"YYYY-MM-DD"格式来显示
DATE_ADD:向日期添加指定的时间间隔