This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://ssl.zc.qq.com/phone/index.html?from=pt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timeago(ptime) | |
local etime =os.time() - ptime | |
if (etime < 1) then | |
return '刚刚' | |
end | |
local interval_ = { | |
{secs = 12 * 30 * 24 * 60 * 60,str=os.date('年前', ptime)} , | |
{secs = 30 * 24 * 60 * 60 ,str=os.date('个月前', ptime)} , | |
{secs = 7 * 24 * 60 * 60 ,str=os.date('周前', ptime)}, | |
{secs = 24 * 60 * 60 ,str='天前'}, |