function getNowDate() {
    let date = new Date();
    let year = date.getFullYear(); //年
    let month = date.getMonth() + 1; //月
    let day = date.getDate(); //日
    let hour = date.getHours(); //时
    let minutes = date.getMinutes(); //分
    let seconds = date.getSeconds(); //秒
    if (month > 1 && month <= 9) month = "0" + month;
    if (day > 0 && day <= 9) day = "0" + day;
    if (hour > 0 && hour < 9) hour = "0" + hour;
    if (minutes > 0 && minutes <= 9) minutes = "0" + minutes;
    if (seconds > 0 && seconds < 9) seconds = "0" + seconds;
    return `${year}-${month}-${day} ${hour}:${minutes}:${seconds}`;
}

//比较两时间之差
function DifferDate(Date1, Date2) {
    if (typeof(Date1) == "string") Date1 = Date.parse(Date1);
    if (typeof(Date2) == "string") Date2 = Date.parse(Date2);
    return Math.floor((Date1 - Date2) / (24 * 3600 * 1000));
}

export {
    getNowDate,
    DifferDate,
}