moment.js/day.js UTC 时间转换为本地时间
import moment from 'moment';
const time = xxx;
moment.utc(time).local().format("YYYY-MM-DD HH:mm:ss")
在Nuxt.js中, 需要将 moment.js
换成 day.js
:
const dayjs = useDayjs();
const time = xxx;
dayjs.utc(time).local().format("YYYY-MM-DD HH:mm:ss")
0 人喜欢
暂无评论,来发布第一条评论吧!