当前位置:网站首页>Moment. JS how to use epoch time to construct objects
Moment. JS how to use epoch time to construct objects
2022-06-24 01:28:00 【HoneyMoose】
If you are right about Epoch If you don't know very well , Please refer to the following post : UNIX Time : New era time (Epoch Time)
Moment.js You can use numbers directly to construct Moment Object's .
It should be noted that Epoch Time may have 2 A digital .
Compare the following 2 A digital :
1635795000000 1635795000
In fact, they all mean a time , The difference is that the first number takes milliseconds , The second number does not .
So in the construction Moment The methods used when creating objects are different .
To a number , We should use :
moment(1635795000000) Just construct it directly .
For the second number , The method that should be used is ,moment.unix(1635795000)
From output , We can see that , If used .unix The way to do it , Will automatically add... After your input data 3 individual 0.
summary
Moment Objects are saved in milliseconds , Therefore, when constructing, if you use numbers to construct objects .
You need to consider the method to use , Otherwise, incorrect conditions may occur .
边栏推荐
- Echo framework: implementing distributed log tracing
- Software cost evaluation: basic knowledge interpretation of cosmoc method
- Installation and use of winscp and putty
- This invincible design can analyze and operate any mathematical expression
- PHP implementation of interval sorting of classified data
- 2022 postgraduate entrance examination experience sharing [preliminary examination, school selection, re examination, adjustment, school recruitment and social recruitment]
- CTF steganography
- How to choose a website construction company self-study website or website construction company
- Kubernetes' ci/cd practice based on Jenkins spinnaker - adding product image scanning
- Echo framework: automatically add requestid
猜你喜欢

Theoretical analysis of countermeasure training: adaptive step size fast countermeasure training

跨域和JSONP

【Flutter】如何使用Flutter包和插件

所见之处都是我精准定位的范畴!显著图可视化新方法开源

Shardingsphere-proxy-5.0.0 implementation of capacity range partition (V)
![Graduation project - thesis writing notes [design topic type, thesis writing details, design materials]](/img/66/c0c400609b56dd012d87c620ca66e4.png)
Graduation project - thesis writing notes [design topic type, thesis writing details, design materials]

【Redis进阶之ZipList】如果再有人问你什么是压缩列表?请把这篇文章直接甩给他。

Installation and use of winscp and putty

Cross domain and jsonp

对抗训练理论分析:自适应步长快速对抗训练
随机推荐
什么是养老理财?养老理财产品有哪些?
How do small businesses do a good job in website construction? Is there any guarantee for network companies to build websites
Talk about 11 tips for interface performance optimization
【Redis进阶之ZipList】如果再有人问你什么是压缩列表?请把这篇文章直接甩给他。
Tencent cloud recruitment order sincerely invites ISV partners for customized development!
Coordinate system "slang" in GIS world
跨域和JSONP
Output type SPED trigger inbound delivery after PGI for inter-company STO's outb
Grab startup logcat
Icml'22 | progcl: rethinking difficult sample mining in graph contrast learning
[technical grass planting] use webhook to automatically deploy my blogs on multiple sites in Tencent cloud
ICML'22 | ProGCL: 重新思考图对比学习中的难样本挖掘
Textfree - reverse engineering of textfree
How does the fixed assets management software reduce costs and increase efficiency for enterprises?
Thread safety and lock optimization
Error reported using worker: uncaught domexception: failed to construct 'worker': script at***
Dart series: metaworld pubspec Yaml file details
Ctfhub miscellaneous --icmp
CSDN auto sign in
Teach you to set up a gift card voucher exchange platform