如何将毫秒转换为相对时间?
how to convert milliseconds to Relative time?
我用moment.js,
我想将毫秒转换为相对时间
从数据库收到:1423554515215
我想将其转换为类似的内容:(1 分钟前)或(5 年前)
更新
完全像 Whosebug post 或评论时间
尝试:
moment(new Date(1423554515215)).fromNow()
现在给 "36 minutes ago"
。
我用moment.js,
我想将毫秒转换为相对时间
从数据库收到:1423554515215
我想将其转换为类似的内容:(1 分钟前)或(5 年前)
更新
完全像 Whosebug post 或评论时间
尝试:
moment(new Date(1423554515215)).fromNow()
现在给 "36 minutes ago"
。