📜  在 javascript 代码示例中获取日期

📅  最后修改于: 2022-03-11 15:03:36.582000             🧑  作者: Mango

代码示例6
function getDate()
{
    let  today         = new Date();
    let  dd         = String(today.getDate()).padStart(2, '0');
    let  mm         = String(today.getMonth() + 1).padStart(2, '0'); //janvier = 0
    let  yyyy         = today.getFullYear();

    return dd + '/' + mm + '/' + yyyy;
}