Msyql 不规则、任意日期转换标准时间

来源:互联网 发布:php sysvmsg windows 编辑:程序博客网 时间:2024/05/18 06:25

select DATE_FORMAT(STR_TO_DATE(end_date, '%d/%m/%Y'), '%Y-%m-%d') from app_coupon_api 

//------------------------------------------------------------------------------------------------------------------------------------------

select count(*) from 
(
select * from app_coupon_api where website = 'Fancyladies.com' and status = 'public' and UNIX_TIMESTAMP(STR_TO_DATE(left(end_date,10), '%m/%d/%Y')) > UNIX_TIMESTAMP(now())
union 
select * from app_coupon_api where website = 'Fancyladies.com' and status = 'public' and UNIX_TIMESTAMP(STR_TO_DATE(left(end_date,10), '%m/%d/%Y')) = 0
union 
select * from app_coupon_api where website = 'Fancyladies.com' and status = 'public' and end_date is null
)t 

0 0
原创粉丝点击