📜  moment js 转换为本地时区 - Javascript 代码示例

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

代码示例1
// MOMENT.JS IS NO LONGER MAINTAINED - SWITCH TO DAY.JS, LUXON, ETC.

const time = moment.tz("2021-04-14T02:08:10.370Z")
const localtz = moment.tz.guess()
const date = time.clone().tz(localtz)
const formatDate = moment(date).format('MMMM Do YYYY, h:mm:ss A z')