代码如下: function _niceTime($minute){ $m = $minute - 5; $date = new DateTime(); $date->setTime(9, 00);//设置每天早上9点 return date("Y-m-d H:i",strtotime("+$m minute",$date->getTimestamp())); }