当前位置:网站首页>JS countdown case
JS countdown case
2022-07-02 06:52:00 【Overnight ξ】
// Countdown cases
function conutDown(time) {
var nowTime = +new Date() // Returns the total number of milliseconds of the current time
var inputTime = +new Date(time) // Returns the total number of milliseconds of user input time
var Times = (inputTime - nowTime) / 1000 // Total milliseconds remaining
var d = parseInt(Times / 60 / 60 / 24)
d = d < 10 ? '0' + d : d
var h = parseInt(Times / 60 / 60 % 24)
var m = parseInt(Times / 60 % 60)
var s = parseInt(Times % 60)
return d + ' God ' + h + ' when ' + m + ' branch ' + s + ' second '
}
console.log(conutDown('2022-2-14 15:00:00'))边栏推荐
- Date time API details
- js删除字符串的最后一个字符
- [daily question] - Huawei machine test 01
- Win10: add or delete boot items, and add user-defined boot files to boot items
- Browser scrolling for more implementations
- JS create a custom JSON array
- Tensorrt command line program
- Kali latest update Guide
- web自动中利用win32上传附件
- Apt command reports certificate error certificate verification failed: the certificate is not trusted
猜你喜欢

Utilisation de la carte et de foreach dans JS

查询GPU时无进程运行,但是显存却被占用了

Solution to the black screen of win computer screenshot

微信小程序基础

UEditor .Net版本任意文件上传漏洞复现

apt命令报证书错误 Certificate verification failed: The certificate is NOT trusted

Win10: add or delete boot items, and add user-defined boot files to boot items

unittest.TextTestRunner不生成txt测试报告

Pytest (1) case collection rules

table 组件指定列合并行方法
随机推荐
查询GPU时无进程运行,但是显存却被占用了
Solution to the black screen of win computer screenshot
ModuleNotFoundError: No module named ‘jieba. analyse‘; ‘ jieba‘ is not a package
sprintf_ How to use s
JS delete the last character of the string
selenium的web自动化中常用的js-修改元素属性翻页
Uploading attachments using Win32 in Web Automation
Nodejs - Express middleware modification header: typeerror [err_invalid_char]: invalid character in header content
unittest. Texttestrunner does not generate TXT test reports
Eggjs -typeorm treeenity practice
Explanation and application of annotation and reflection
Error "list" object is not callable in Web automatic switching window
uniapp引入本地字体
Promise中有resolve和无resolve的代码执行顺序
[self cultivation of programmers] - Reflection on job hunting Part II
js创建一个自定义json数组
Win10网络图标消失,网络图标变成灰色,打开网络设置闪退等问题解决
20210306 reprint how to make TextEdit have background pictures
Render minecraft scenes into real scenes using NVIDIA GPU
CUDA and Direct3D consistency