Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: dayjs
node v10.24.1
endpoint
share
tweet
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…
Clone and edit this document