如何将 UTC 字符串转换为 jQuery 中的格式化日期

How to convert a UTC String to a Formatted Date in jQuery

我的 UTC 日期如下: 2021 年 8 月 30 日星期一 00:00:00 GMT-0400(东部夏令时)

是否有任何 jQuery 或 JavaScript 函数可以将 UTC 日期字符串转换为 mm/dd/yyyy 格式?

我四处寻找,没有找到任何东西。谢谢!

您可以使用 Date.parse 和 Intl.datetimeformat,如

console.log(new Intl.DateTimeFormat('en-US').format(Date.parse("Mon Aug 30 2021 00:00:00 GMT-0400 (Eastern Daylight Time)")));