我有一个时间戳列表,列出了备份文件。但为了减少所需的空间量,我只想保留大约在中午左右的文件 - 我已经开始编写函数检查,但遇到困难,我该如何检查当天的时间戳是否在12和1之间?我有很多天的时间戳列表。检查时间戳列表在当天12和1之间
function check_date($timestamp='')
{
if (($timestamp < strtotime("-1 week")) && (time is between 12 and 1)){
}
else
remove
}
可能dublicate:http://stackoverflow.com/questions/4757078/get-the-correct-hour-for-a-unix-timestamp – Peon 2012-07-24 12:04:36