这些选项中哪一个应该使用?
看起来它们返回相同的结果。
const event = new Date(1521065710000);
const options = {
day: 'numeric',
month: 'long',
weekday: 'short',
hour: 'numeric',
minute: 'numeric',
timeZoneName: 'short',
timeZone: 'America/Los_Angeles',
};
console.log(event.toLocaleString('en-US', options));
// "Wed, March 14, 3:15 PM PDT"
console.log(new Intl.DateTimeFormat('en-US', options).format(event));
// "Wed, March 14, 3:15 PM PDT"