RunKit + npm: dayjs

node v10.24.1
endpointsharetweet
var dayjs = require("dayjs") var utc = require('dayjs/plugin/utc') var timezone = require('dayjs/plugin/timezone') require('dayjs/locale/en-gb') dayjs.extend(utc); dayjs.extend(timezone); console.log(dayjs('2020-11-06T19:27:08Z').locale('en-gb').tz('Europe/London').format('DD MMM, HH:mm a')) console.log(dayjs('2020-11-06T19:27:08Z').tz('Europe/London').locale('en-gb').format('DD MMM, HH:mm a')) require('dayjs/locale/el') console.log(dayjs('2020-11-06T19:27:08Z').locale('el').tz('Europe/London').format('DD MMM, HH:mm a')) console.log(dayjs('2020-11-06T19:27:08Z').tz('Europe/London').locale('el').format('DD MMM, HH:mm a')) require('dayjs/plugin/customParseFormat') var dayjsStr = dayjs('2020-11-06T19:27:08Z').tz('Europe/London').format('YYYY-MM-DD HH:mm'); console.log(dayjs(dayjsStr, 'YYYY-MM-DD HH:mm').locale('en-gb').format('DD MMM, HH:mm a'));
Created from: https://npm.runkit.com/dayjs
Loading…