当前位置:网站首页>JS calculates the display date according to the time
JS calculates the display date according to the time
2022-04-23 03:26:00 【Open the door of the world】
getTime() {
getTime(
'',
(res) => {
console.log(' system time ', res.data.data.time_now)
this.nowTime = res.data.data.time_now
this.orderData.forEach((val, index) => {
let newTime = (val.expire_time - this.nowTime) * 1000
console.log('newTime', newTime)
let days = Math.floor(newTime / (24 * 3600 * 1000)) // Calculate the number of days
let leavel = newTime % (24 * 3600 * 1000) // Time remaining after calculating days
let hours = Math.floor(leavel / (3600 * 1000)) // Count the remaining hours
let leavel2 = leavel % (3600 * 1000) // Calculate the number of milliseconds remaining after the remaining hours
let minutes = Math.floor(leavel2 / (60 * 1000)) // Count the minutes left
if (days === 0) {
var tt = `${
hours} Hours ${
minutes} minute `
} else if (hours === 0) {
var tt = `${
minutes} minute `
} else {
var tt = `${
days} God ${
hours} Hours ${
minutes} minute `
}
this.$set(this.orderData[index], 'tt', tt)
})
},
(err) => {
console.log('err', err)
}
)
console.log('orderData', this.orderData)
},
版权声明
本文为[Open the door of the world]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220619451567.html
边栏推荐
- IOTOS物联中台对接海康安防平台(iSecure Center)门禁系统
- Idempotency practice operation, explaining idempotency based on business
- 幂等性实践操作,基于业务讲解幂等性
- Peut recevoir plusieurs paramètres de type de données - paramètres variables
- The query type of MySQL is very inefficient.
- 2022年做跨境电商五大技巧小分享
- 超好用的Excel异步导出功能
- Fiddler use
- Unity Basics
- Learn about I / O flow and file operations
猜你喜欢

Why is bi so important to enterprises?

研讨会回放视频:如何提升Jenkins能力,使其成为真正的DevOps平台

Seminar playback video: how to improve Jenkins' ability to become a real Devops platform

Unity knowledge points (ugui)

超好用的【通用Excel导入功能】

Top 9 task management system in 2022

Problem a: face recognition

Chapter 9 of C language programming (fifth edition of Tan Haoqiang) analysis and answer of exercises for users to establish their own data types

Visual programming - Experiment 1
![Detailed description of MySQL index [B + tree index, hash index, full-text index, overlay index]](/img/1a/a22b4a35d3c083438d0f766a5ecb08.png)
Detailed description of MySQL index [B + tree index, hash index, full-text index, overlay index]
随机推荐
第四次作业
Advanced sorting - fast sorting
Query stored procedures in PostgreSQL
JSON related
为什么BI对企业这么重要?
Supersocket is Used in net5 - command
Unity Basics
. net webapi access authorization mechanism and process design (header token + redis)
MySQL grouping query rules
QT learning summary
移植tslib时ts_setup: No such file or directory、ts_open: No such file or director
批量下載文件----壓縮後再下載
C interface
Utgard connection opcserver reported an error caused by: org jinterop. dcom. common. JIRuntimeException: Access is denied. [0x800
Comprehensive calculation of employee information
2022 团体程序设计天梯赛 模拟赛 1-8 均是素数 (20 分)
JS inheritance
2022g2 boiler stoker examination question bank and online simulation examination
打卡:4.23 C语言篇 -(1)初识C语言 - (12)结构体
C-10 program error correction (recursive function): number to character