Date 与 Intl 格式化 | 星雨笔录

创建日期并进行地区化格式输出。

核心: Date 保存时间;Intl.DateTimeFormat 按地区格式化显示日期。

最小示例:

const now = new Date();
console.log(new Intl.DateTimeFormat('zh-CN', { dateStyle: 'long' }).format(now));

学完能做: 创建日期并进行地区化格式输出。