How do you get a timestamp in JavaScript?

前端 未结 30 3129
情深已故
情深已故 2020-11-21 15:19

How can I get a timestamp in JavaScript?

Something similar to Unix timestamp, that is, a single number that represents the current time and date. Either as a number

30条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-11-21 15:35

    For lodash and underscore users, use _.now.

    var timestamp = _.now(); // in milliseconds
    

提交回复
热议问题