use*_*482 0 php unix-timestamp
比方说,我有一个unix时间戳1345810244,我想做的是有一个函数来检查这个时间戳是否与今天相同,即
function isToday($unixTimestamp) {
if ($unixTimestamp == (today){
return true;
else
return false;
}
Run Code Online (Sandbox Code Playgroud)
我很高兴处理unix时间戳,谢谢.
if (date('Y-m-d', $timestamp) == date('Y-m-d')) {
// yes, it's the same day
}
Run Code Online (Sandbox Code Playgroud)