我想用Moment.js得到Unix的TimeStamp。我可以在moment.js中找到许多将时间戳转换为日期的函数。我知道通过使用下面的JavaScript函数:Math.floor(new Date().getTime()/1000),我可以很容易地获得unix时间戳。
Math.floor(new Date().getTime()/1000)
但是我想使用Moment.js来获得相同的结果。moment.js中有没有直接获取当前时间戳的函数?
https://stackoverflow.com/questions/25499191
相似问题