Finding date by subtracting X number of days from a particular date in Javascript

后端 未结 9 1987
滥情空心
滥情空心 2020-11-27 05:21

I want to find date by subtracting X number of days from a particular date in JavaScript. My JavaScript function accepts 2 parameters. One is the date value and the other i

9条回答
  •  北荒
    北荒 (楼主)
    2020-11-27 06:19

    Just another option, which I wrote:

    DP_DateExtensions Library

    It's probably overkill if ALL you want to do is one calculation, but if you're going to do more date manipulation you might find it useful.

    Supports date/time formatting, date math (add/subtract date parts), date compare, date parsing, etc.

提交回复
热议问题