*/ function tranTime($time) { $rtime = date("m-d H:i",$time); $htime = date("H:i",$time); $time = time() - $time; if ($time < 60) { $str = '剛剛'; } elseif ($time < 60 * 60) { $min = floor($time/60); $str = $min.' 分鐘前'; } elseif ($time < 60 * 60 * 24) { $h = floor($time/(60*60)); $str = $h.' 小時(shí)前 '; } elseif ($time < 60 * 60 * 24 * 3) { $d = floor($time/(60*60*24)); if($d==1) $str = '昨天 '; else $str = '前天 '; } else { $str = $rtime; } return $str; } |
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: 織夢dede 模板下載實(shí)現(xiàn)某小時(shí)前,某天前發(fā)布的時(shí)間標(biāo)簽代碼