·

moment.js/day.js UTC time to local time

Published at 2024-05-07 23:32:59Viewed 314 times
Professional article
Please reprint with source link
import moment from 'moment';

const time = xxx;
moment.utc(time).local().format("YYYY-MM-DD HH:mm:ss")

In Nuxt.js, you need to change moment.js to day.js.

const dayjs = useDayjs();

const time = xxx;
dayjs.utc(time).local().format("YYYY-MM-DD HH:mm:ss")


0 人喜欢

Comments

There is no comment, let's add the first one.

弦圈热门内容

Get connected with us on social networks! Twitter

©2024 Guangzhou Sinephony Technology Co., Ltd All Rights Reserved