我有一個時間戳列表,列出了備份文件。但爲了減少所需的空間量,我只想保留大約在中午左右的文件 - 我已經開始編寫函數檢查,但遇到困難,我該如何檢查當天的時間戳是否在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