Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

RunKit + npm: dayjs

node v10.24.1
version: master
endpointsharetweet
var dayjs = require("dayjs@1.10.4") var utc = require('dayjs/plugin/utc'); var timezone = require('dayjs/plugin/timezone'); dayjs.extend(utc); dayjs.extend(timezone); var moment = require('moment-timezone'); const dates = ['2019-10-30', '2019-11-01', '2020-10-30', '2020-11-01'] dates.forEach(date => { const dayjsOffset = dayjs(date).tz('America/Sao_Paulo').format('Z') const momentOffset = moment(date).tz('America/Sao_Paulo').format('Z') console.log(`Offset for ${date} | dayjs: ${dayjsOffset} | moment: ${momentOffset} | equal ${dayjsOffset == momentOffset}`) })
Created from: https://npm.runkit.com/dayjs
Loading…

no comments

    sign in to comment