📜  date javascript 仅显示日月年 - Javascript 代码示例

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

代码示例2
const event = new Date('2021-09-07');

const options = { year: 'numeric', month: 'long' };

console.log(event.toLocaleDateString('de-DE', options));
// expected output: September 2021

console.log(event.toLocaleDateString('ja-JP', options));
// expected output: 2021年9月