当前位置:网站首页>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:
边栏推荐
- Lsky Pro 企业版手动升级、优化教程
- In the background of the GBase 8c database, what command is used to perform the master-slave switchover operation for the gtm and dn nodes
- pytest interface automation testing framework | skip test classes
- Redis 3.2.3 crashed by signal: 11 服务宕机问题排查
- Pod environment variables and initContainer
- [Tear AHB-APB Bridge by hand]~ Why aren't the lower two bits of the AHB address bus used to represent the address?
- GO error handling
- leetcode 42. Catch the rain
- 笔记。。。。
- network basic learning
猜你喜欢

Chapter 9 of Huawei Deep Learning Course - Convolutional Neural Network and Case Practice

三子棋(C语言实现)

JVM内存模型之深究模型特征

自定义IP在PCIE中使用

Parsing MySQL Databases: "SQL Optimization" vs. "Index Optimization"

scrapy爬虫框架的使用

leetcode-6134:找到离给定两个节点最近的节点

报告:想学AI的学生数量已涨200%,老师都不够用了

力扣周赛304 6135. 图中的最长环 内向基环树
改版去不图床 Token 的获取
随机推荐
三子棋(C语言实现)
消息队列面试题(2022最新整理)
leetcode-6132:使数组中所有元素都等于零
Analysis of High Availability Solution Based on MySql, Redis, Mq, ES
leetcode 42. Catch the rain
C语言中编译时出现警告C4013(C语言不加函数原型产生的潜在错误)
Go supports OOP: use struct instead of class
Microsoft Azure & NVIDIA IoT 开发者季 I|Azure IoT & NVIDIA Jetson 开发基础
杰理AD14N/AD15N---串口中断问题
Get the Token from the revised version of Qubutu Bed
HoloView -- Tabular Datasets
用OpenCV的边缘检测
静态Pod、Pod创建流程、容器资源限制
Go-Excelize API源码阅读(八)——GroupSheets(sheets []string)、UngroupSheets()
Mysql数据库的部署以及初始化步骤
【应用推荐】常见资源管理器整理,含个人使用体验和产品选型推荐
2022杭电中超杯(1)个人题解
【杭电多校第四场 B题】最短路图+缩点dp
Redis middleware (from building to refuse pit)
How to get page data