当前位置:网站首页>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 .
边栏推荐
- Ctfhub miscellaneous --icmp
- Theoretical analysis of countermeasure training: adaptive step size fast countermeasure training
- How to select storage space for website construction what factors should be considered in selecting space
- 2021-11-19:[0,4,7]:0 means that the stone here has no color. If it turns red
- How to realize IP invariance in the private network of basic network ECs and cloud database resource switching
- Golang gets the start timestamp and end timestamp of a past or future week or month
- How to implement NSQ delay streaming technology in easycvr?
- One article introduces you to the world of kubernetes
- Mobile direct payment, super convenient
- How to build a high-quality website
猜你喜欢

Icml'22 | progcl: rethinking difficult sample mining in graph contrast learning
Shengdun technology joined dragon lizard community to build a new open source ecosystem

An accident caused by a MySQL misoperation, and the "high availability" cannot withstand it!

js输入输出语句,变量
![[shutter] how to use shutter packages and plug-ins](/img/a6/e494dcdb2d3830b6d6c24d0ee05af2.png)
[shutter] how to use shutter packages and plug-ins

Everything I see is the category of my precise positioning! Open source of a new method for saliency map visualization

Zhongshanshan: engineers after being blasted will take off | ONEFLOW u

Cross domain and jsonp

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

【Flutter】如何使用Flutter包和插件
随机推荐
JS input / output statements, variables
How to realize IP invariance in the private network of basic network ECs and cloud database resource switching
Dart series: creating a library package
How to learn website construction does website construction need code
Spatial4j introduction practice
AES encryption analysis of CNKI academic translation
Everything I see is the category of my precise positioning! Open source of a new method for saliency map visualization
. Net core cross platform development bbs forum (connotation source code + complete operation video)
Cvpr2022 𞓜 thin domain adaptation
ICML'22 | ProGCL: 重新思考图对比学习中的难样本挖掘
If the program exits abnormally, how to catch the fatal error through the go language?
Batch generation of 2D codes from txt files
Solution of self Networking Wireless Communication intercom system in Beifeng oil and gas field
PHP implementation of interval sorting of classified data
How does smart digital operation get through offline collection and online marketing?
How to build a pagoda panel web site on Tencent ECS?
How to realize court face recognition / flow statistics based on easycvr technology?
Force buckle deletes duplicates in the sort array
Talk to Wu Jiesheng, head of Alibaba cloud storage: my 20 years of data storage (unlimited growth)
2021-11-21: map[i][j] = = 0, which means that (I, J) is an ocean. If you cross it, the cost will be