Unix Timestamp (milliseconds)1.0.0+
moment().valueOf();
+moment();
moment#valueOf
simply outputs the number of milliseconds since the Unix Epoch, just like Date#valueOf
.
moment(1318874398806).valueOf(); // 1318874398806
+moment(1318874398806); // 1318874398806
To get a Unix timestamp (the number of seconds since the epoch) from a Moment
, use moment#unix
.
当前内容版权归 momentjs.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 momentjs.com .