当前位置:网站首页>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:
边栏推荐
- leetcode-6135:图中的最长环
- 常见的API安全缺陷有哪些?
- 179. 最大数
- UXDB如何返回当前数据库所有表的记录数?
- 22 Niu Ke Duo School 1 I. Chiitoitsu (Probability dp)
- Centos install php7.4, build hyperf, forward RDS
- Microsoft Azure & NVIDIA IoT developers season I | Azure IoT & NVIDIA Jetson development foundation
- 灵魂发问:MySQL是如何解决幻读的?
- 【Unity3D】相机
- HPC系统简介
猜你喜欢

leetcode-6133: maximum number of groupings
![[Dataset] Dataset summary of various insulators, bird's nests and anti-vibration hammers](/img/02/927f4e228eb3abbd76cade5be00352.png)
[Dataset] Dataset summary of various insulators, bird's nests and anti-vibration hammers

Custom IP used in PCIE

【STM32】入门(一):环境搭建、编译、下载、运行

opencv创建窗口—cv.namedWindow()

codeforces每日5题(均1600)-第二十七天

Redis学习

HoloView 在 jyputer lab/notebook 不显示总结

JVM 运行时数据区与JMM 内存模型详解

《时代》杂志:元宇宙时代将改变世界
随机推荐
VoLTE Basic Learning Series | Enterprise Voice Network Brief
巧妙利用unbuffer实时写入
JVM 运行时数据区与JMM 内存模型详解
net stop/start mysql80 拒绝访问
杰理AD14N/AD15N---串口中断问题
Pytest | skip module interface test automation framework
BGP综合实验
2022.7.31-----leetcode.1161
Mysql database deployment and initialization steps
372. 超级次方
Data Analysis 5
网络个各种协议
net stop/start mysql80 access denied
What do the values 1, 2, and 3 in nodetype mean?
基于MySql,Redis,Mq,ES的高可用方案解析
pytest interface automation testing framework | parametrize source code analysis
[Beyond programming] When the fig leaf is lifted, when people begin to accept everything
leetcode-6132:使数组中所有元素都等于零
【应用推荐】常见资源管理器整理,含个人使用体验和产品选型推荐
Optimal dazzle Oracle database support what kinds of type of the time and date