Node.js
要开始在 Node.js 项目中使用 Day.js,只需将依赖添加到 Node.js 包管理器即可。
¥To get started with Day.js in your Node.js project, simply add the dependency to your Node.js package manager.
npm install dayjs
# or
yarn add dayjs
# or
pnpm add dayjs
然后将其包含在你的脚本中:
¥Then include it in your script:
const dayjs = require('dayjs')
//import dayjs from 'dayjs' // ES 2015
dayjs().format()
¥Check here for more information about loading locale and plugin.