//2018年01月01日 时间戳
$start_timestamp = '1514764800';
//2018年12月31日 时间戳
$end_timestamp = '1546214400;
//获得该时间段内所有日期列表
for($i = $start_timestamp; $i <= $end_timestamp; $i += 86400)
{
$Date = date("Y-m-d", $i);
print $Date."\n";
}
运行结果:
2018-01-01 2018-01-02 2018-01-03 2018-01-04 ..... 2018-12-31
Made by 米云科技
Code licensed under the
Apache License v2.0.
Based on
Bootstrap.
Icons from
Font Awesome
豫ICP备18012765号-2
00001