【发布时间】:2011-02-18 19:29:02
【问题描述】:
我需要 unix 时间戳 - 我拥有的时间戳。然后在twitter上显示like之间的时间。
【问题讨论】:
我需要 unix 时间戳 - 我拥有的时间戳。然后在twitter上显示like之间的时间。
【问题讨论】:
如果有区别就叫diff:
$seconds = intval($diff) % 60;
$minutes = intval($diff/60) % 60;
$hours = intval($diff/3600) % 24;
$days = intval($diff/(3600*24));
这是你想要的吗?
【讨论】:
不确定你需要什么语言,但如果它最终会出现在网页中,你可以试试timeago。
【讨论】:
echo time_elapsed_string('@1367367755');
echo time_elapsed_string('@1367367755', true);
4 months ago
4 months, 2 weeks, 3 days, 1 hour, 49 minutes, 15 seconds ago
【讨论】: