Javascript DateDiff

后端 未结 4 1774
星月不相逢
星月不相逢 2021-01-12 04:15

I am having a problem with the DateDiff function. I am trying to figure out the Difference between two dates/times. I have read this posting (What's the best way to calc

4条回答
  •  长情又很酷
    2021-01-12 04:40

    No need to include JQuery or any other third party library.

    Specify your input date format in title tag.

    HTML:

    < script type="text/javascript" src="http://services.iperfect.net/js/IP_generalLib.js">
    

    Use javascript function:

    IP_dateDiff(strDate1,strDate2,strDateFormat,debug[true/false])
    
    alert(IP_dateDiff('11-12-2014','12-12-2014','DD-MM-YYYY',false));
    

    IP_dateDiff function will return number of days.

提交回复
热议问题