📜  php 将 2 个日期值传递给 javascript - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:52.200000             🧑  作者: Mango

代码示例1
function dateDiff() {
    
    var date1 = new Date(document.getElementById("fromDatePicker").value);
    var date2 = new Date(document.getElementById("toDatePicker").value);
    var difference = date2 - date1;
    var days = difference/(24*3600*1000);
    document.getElementById('hari').value=days;
    }