当前位置:网站首页>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 .
边栏推荐
- How to build a pagoda panel web site on Tencent ECS?
- Solution of self Networking Wireless Communication intercom system in Beifeng oil and gas field
- [technical grass planting] deploy a super large capacity and unlimited speed network disk in Tencent cloud
- November 20, 2021: the start and end times of a movie can be listed in a small array
- How to self-study website construction is website construction company reliable
- Coding compass -- creating a software factory like a flowing cloud
- Implementation of automatic triggering of inward delivery order after outward delivery order PGI in SAP inter company sto process
- ctfhub---SSRF
- What is the suffix of the domain name for trademark registration? What are the differences between trademarks and domain names?
- Echo framework: implementing distributed log tracing
猜你喜欢

LMS Virtual. Derivation method of lab acoustic simulation results

Use recursion to form a multi-level directory tree structure, with possibly the most detailed notes of the whole network.
![[shutter] how to use shutter packages and plug-ins](/img/a6/e494dcdb2d3830b6d6c24d0ee05af2.png)
[shutter] how to use shutter packages and plug-ins

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

ICML'22 | ProGCL: 重新思考图对比学习中的难样本挖掘
![[redis advanced ziplist] if someone asks you what is a compressed list? Please dump this article directly to him.](/img/3f/988ed31a3f1cdc92deed121ed8d4ec.png)
[redis advanced ziplist] if someone asks you what is a compressed list? Please dump this article directly to him.
Shengdun technology joined dragon lizard community to build a new open source ecosystem
Talk to Wu Jiesheng, head of Alibaba cloud storage: my 20 years of data storage (unlimited growth)

13 `bs_ duixiang. Tag tag ` get a tag object

Everything I see is the category of my precise positioning! Open source of a new method for saliency map visualization
随机推荐
Radware load balancer common maintenance query commands
[planting grass by technology] 13 years' record of the prince of wool collecting on the cloud moving to Tencent cloud
JS stack memory
How to self-study website construction is website construction company reliable
SAP executes PGI on the delivery order of STO and reports an error -fld selectn for Mvmt type 643 acct 400020 differences
【Flutter】如何使用Flutter包和插件
Server performance monitoring: Best Practices for server monitoring
Teach you to set up a gift card voucher exchange platform
[redis advanced ziplist] if someone asks you what is a compressed list? Please dump this article directly to him.
CSDN articles crawl the top ten bloggers' articles and convert them to MD
Selenium crawls stocks in practice
Mobile direct payment, super convenient
Salesforce uses hyperlink formula field to implement custom jump
ctfhub---SSRF
Cloud computing "keeping the promise"
The dispute between traditional IT development and low code development is heated, and the technical development rules may be restructured?
Solve the problem that Base64 compressed files are extracted with spaces after post request
[OSG] OSG development (04) - create multiple scene views
【Redis进阶之ZipList】如果再有人问你什么是压缩列表?请把这篇文章直接甩给他。
Coordinate system "slang" in GIS world