<?php
$starttime="2012-08-13 12:00:00";
$endtime="2012-08-14 12:00:00";for($start = strtotime($starttime); $start <= strtotime($endtime);$start += 3600) //我这里是按每小时遍历,所以每次增加3600秒
{
echo date('Y-m-d H:i:s',$start)."\n";
}
?>
<?php
$starttime="2012-08-13 12:00:00";
$endtime="2012-08-14 12:00:00";