How to add 30 minutes to a JavaScript Date object?

前端 未结 20 2971
醉酒成梦
醉酒成梦 2020-11-21 23:21

I\'d like to get a Date object which is 30 minutes later than another Date object. How do I do it with JavaScript?

20条回答
  •  感情败类
    2020-11-22 00:13

    Just another option, which I wrote:

    DP_DateExtensions Library

    It's overkill if this is all the date processing that you need, but it will do what you want.

    Supports date/time formatting, date math (add/subtract date parts), date compare, date parsing, etc. It's liberally open sourced.

提交回复
热议问题