javascript - Get a timespan in milliseconds using momentjs - Stack Overflow

I try the following to get a timespan in milliseconds: moment(0).minute(10).milliseconds()The idea is t

I try the following to get a timespan in milliseconds:

moment(0).minute(10).milliseconds()

The idea is to have a simple and readable way to convert timespans into milliseconds. But unfortunately this will always return 0, the initial time.

I try the following to get a timespan in milliseconds:

moment(0).minute(10).milliseconds()

The idea is to have a simple and readable way to convert timespans into milliseconds. But unfortunately this will always return 0, the initial time.

Share Improve this question asked Jun 25, 2013 at 14:19 Andreas KöberleAndreas Köberle 111k58 gold badges280 silver badges307 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

I think this is what you actually want to do:

moment.duration(10, "minutes").asMilliseconds();

I don't know if I got your question, but we can use JavaScript for timestamps

var start = new Date().getTime();
var elapsed = new Date().getTime() - start;

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742298560a4417609.html

相关推荐

  • javascript - Get a timespan in milliseconds using momentjs - Stack Overflow

    I try the following to get a timespan in milliseconds: moment(0).minute(10).milliseconds()The idea is t

    16小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信