比如把: “2009-02-14 18:50 发表”<br>转成:“一个小时前发表”<br>
<?php <br/>function format_date($date)<br>{<br> $limit = time() - $date;<br> if($limit {<br> return $limit . '秒钟之前';<br> }<br> if($limit >= 60 && $limit {<br> return floor($limit/60) . '分钟之前';<br> }<br> if($limit >= 3600 && $limit {<br> return floor($limit/3600) . '小时之前';<br> }<br> if($limit >= 86400)<br> {<br> return date('Y-m-d H:i:s', $date);<br> }<br>}<br>$time = 1234613275;<br>echo format_date($time);<br>?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver CS6
Visual web development tools

Dreamweaver Mac version
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools
