This question already has answers here:
Convert Unix timestamp into human readable date using MySQL
                                
                                    (8个答案)
                                
                        
                                4年前关闭。
            
                    
我从数据库中获取数据时遇到问题,我的日期fromat是1438697362此值来自此php默认函数time();的结果

我很困惑如何使用这种时间和日期格式获取数据。

select * from table_name
where  created_date
BETWEEN '1438697362' AND '1440843077'


谁能在这件事上帮助我。

最佳答案

select * from table_name where created_date BETWEEN FROM_UNIXTIME(1438697362) AND FROM_UNIXTIME(1440843077)


要么

select * from table_name where UNIX_TIMESTAMP(created_date) BETWEEN 1438697362 AND 1440843077

10-08 04:43