当前位置:网站首页>Node's traditional and advanced practices for formatting time (moment)
Node's traditional and advanced practices for formatting time (moment)
2022-08-01 09:24:00 【quite a bit】
Traditional way of formatting time
Zero paddingMethod:
The method that takes time (except year,Others need to be filled with zeros):
Expose dateFormat method
Import a custom formatted time module and use
>
Result:
dt gets the current time, and then converts dt through the dateDormat method in the introduced TIME
Advanced practice of formatting:
Do not encapsulate it yourself, use a third-party package
command to install package in project
View how to use moment
npmjs website search moment
Click in
You can see the package on the rightcommand required when
The version number of the package, the weekly download amount Weekly Download
Note: To see how to use moment, click Documentation on the left (or right click to open the link in a new tab)
Pull down to view the parameters that can be passed in:
etc.
Note: Hh mm will be filled with zeros when they represent reality.
Use and results:
边栏推荐
- sqlserver怎么查询一张表中同人员的交叉日期
- sql server, FULL mode, dbcc shrinkfile(2,1) can not shrink the transaction log, or the original size, why?
- 179. 最大数
- Graduation thesis writing skills
- 将aof文件转换为命令waoffle安装和使用
- CTO强烈禁止使用Calendar,那用啥?
- 获取页面数据的方法
- XX市消防救援指挥中心实战指挥平台多链路聚合解决方案实例
- navicat mysql 内存占用过高,被强制关闭
- Gethostbyname \ getaddrinfo DNS domain name IP address is not safe
猜你喜欢
【杭电多校第四场 B题】最短路图+缩点dp
Microsoft Azure & NVIDIA IoT 开发者季 I|Azure IoT & NVIDIA Jetson 开发基础
Parsing MySQL Databases: "SQL Optimization" vs. "Index Optimization"
network basic learning
Case practice --- Resnet classic convolutional neural network (Mindspore)
YOLOv7-Pose尝鲜,基于YOLOv7的关键点模型测评
sqlserver怎么查询一张表中同人员的交叉日期
BGP综合实验
leetcode-6133:分组的最大数量
【Unity3D】相机
随机推荐
Holoview--Introduction
Pod环境变量和initContainer
如何保证数据库与缓存数据一致性?
企业数据虚拟化综合指南
热修复技术可谓是百花齐放
js中如何实现深拷贝?
GO error handling
scrapy爬虫框架的使用
sqlserver 对比两张表的差异
Chapters 6 and 7 of Huawei Deep Learning Course
codeforces每日5题(均1600)-第二十七天
Pytest | skip module interface test automation framework
sql server, FULL模式, dbcc shrinkfile(2,1) 不能收缩事务日志,还是原来的大小,是为什么?
sqlserver怎么查询一张表中同人员的交叉日期
Static Pod, Pod Creation Process, Container Resource Limits
基于tika实现对文件类型进行判断
Ogg synchronizes oracle to mysql, there may be characters that need to be escaped in the field, how to configure escape?
zip package all files in the directory (including hidden files/folders)
MySQL查询进阶——从函数到表连接的使用你还记得吗
高级驾驶辅助系统ADAS简介