📌  相关文章
📜  以 12 小时格式在 javascript 中获取当前日期时间 - Javascript 代码示例

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

代码示例2
//this will give you date object remove the outer new Date to have 
//it as string
const today = new Date(new Date().toLocaleString("en-US", {
    day: '2-digit',
    month: '2-digit',
    year: 'numeric',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit',
    hour12: true
}));