Semantically, you're probably looking for the one-liner(在语义上,你可能正在寻找单线)
new Date().toLocaleString()
which formats the date in the locale of the user.(它在用户的语言环境中格式化日期。)
If you're really looking for a specific way to format dates, I recommend the moment.js library.(如果您真的在寻找一种特定的日期格式,我推荐使用moment.js库。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…