UTC
UTC は、UTC で解析または表示するための `.utc`、`.local`、`.isUTC` API を追加します。
var utc = require('dayjs/plugin/utc')
dayjs.extend(utc)
// default local time
dayjs().format() //2019-03-06T17:11:55+08:00
// UTC mode
dayjs.utc().format() // 2019-03-06T09:11:55Z
// convert local time to UTC time
dayjs().utc().format() // 2019-03-06T09:11:55Z
// While in UTC mode, all display methods will display in UTC time instead of local time.
// And all getters and setters will internally use the Date#getUTC* and Date#setUTC* methods instead of the Date#get* and Date#set* methods.
dayjs.utc().isUTC() // true
dayjs.utc().local().format() //2019-03-06T17:11:55+08:00
dayjs.utc('2018-01-01', 'YYYY-MM-DD') // with CustomParseFormat plugin
デフォルトでは、Day.js はローカル時間で解析および表示します。
UTC で解析または表示する場合は、`dayjs()` の代わりに `dayjs.utc()` を使用できます。
dayjs.utc `dayjs.utc(dateType?: string | number | Date | Dayjs, format?: string)`
UTCモードの`Dayjs`オブジェクトを返します。
UTC時間を使用する `.utc()`
UTC時間を使用するフラグが設定された、クローンされた`Dayjs`オブジェクトを返します。
ローカル時間を使用する `.local()`
ローカル時間を使用するフラグが設定された、クローンされた `Dayjs` オブジェクトを返します。
UTCオフセットを設定する `.utcOffset()`
新しいUTCオフセットが設定された、クローンされた`Dayjs`オブジェクトを返します。
isUTCモード `.isUTC()`
現在の`Dayjs`オブジェクトがUTCモードであるかどうかを示す`boolean`値を返します。