3
【笔记】Nodejs的moment模块学习笔记
source link: https://en.loli.fj.cn/2022/12/11/Nodejs%E7%9A%84moment%E6%A8%A1%E5%9D%97%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
【笔记】Nodejs的moment模块学习笔记
2022-12-11
Nodejs中利用moment模块进行时间日期格式化
npm install moment
时间日期格式化
- 通过
moment()
函数获取当前时间 - 通过
format()
函数格式化时间
const moment = require("moment");
let time = moment().format("YYYY-MM-DD HH:mm:ss");
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK