时间:2021-07-01 10:21:17 帮助过:37人阅读
  getdate -- 取得日期/时间信息  
 说明  
 array getdate ( [int timestamp] )  
 返回一个根据 timestamp 得出的包含有日期信息的结合数组。如果没有给出时间戳则认为是当前本地时间。  
 
  你的意思是你的一个字段存储的是时间戳,如果是的话我们这样来做:  
 [code=php  
 ]$today = date('Y-m-d');  
 $startTime = strtotime($today); //今天凌晨时间戳  
 $endTime   = $startTime+24*3600;//明天凌晨时间戳  
 $sql       = "select * from table where time between $startTime and $endTime";  
 //执行sql  
 [/code]  
 但是不知道效率如何,给你一个建议,根据高性能Mysql存储时间最好还是用日期根式