繁體中文
外觀
此方法會返回一個 Day.js 物件,該物件已被標記為使用 UTC 時間。
TIP
需要先引入 UTC 插件
dayjs.extend(utc); var a = dayjs(); a.format(); //2019-03-06T08:00:00+08:00 a.utc().format(); // 2019-03-06T00:00:00Z
傳入 true 將會變更時區,但保持時間點(瞬間)不變。
true
dayjs('2016-05-03 22:15:01').utc(true).format() // 2016-05-03T22:15:01Z
了解更多關於 UTC 模式 的資訊。