[removed] Calculate difference between two dates

前端 未结 4 1731
温柔的废话
温柔的废话 2021-01-15 03:23

I want to find difference between two Dates. For that I did subtract one Date object from another Date object. My code is as follows :

var d1 = new Date(); /         


        
4条回答
  •  鱼传尺愫
    2021-01-15 03:58

    Are you looking for this?

    Math.ceil((new Date(2012, 11, 23) - new Date(2012, 11, 21)) / 864000) + 1

提交回复
热议问题