当前位置:网站首页>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'))
边栏推荐
- 20201002 vs 2019 qt5.14 developed program packaging
- Solution to the black screen of win computer screenshot
- The use of regular expressions in JS
- Latex warning: citation "*****" on page y undefined on input line*
- Vscode installation, latex environment, parameter configuration, common problem solving
- Functions of tensorrt
- js删除字符串的最后一位
- The default Google browser cannot open the link (clicking the hyperlink does not respond)
- Fe - eggjs combined with typeorm cannot connect to the database
- There are multiple good constructors and room will problem
猜你喜欢
uniapp引入本地字体
SQL注入闭合判断
js中map和forEach的用法
Sublime text configuring PHP compilation environment
Latex在VSCODE中编译中文,使用中文路径问题解决
Solve the problem of bindchange event jitter of swiper component of wechat applet
[literature reading and thought notes 13] unprocessing images for learned raw denoising
In depth study of JVM bottom layer (IV): class file structure
Latex error: the font size command \normalsize is not defined problem solved
Win电脑截图黑屏解决办法
随机推荐
(the 100th blog) written at the end of the second year of doctor's degree -20200818
PIP install
Self cultivation of programmers - Reflection on job hunting
Win10桌面图标没有办法拖动(可以选中可以打开可以删除新建等操作但是不能拖动)
js删除字符串的最后一位
Sqli labs customs clearance summary-page3
JS to determine whether there is a value in the object in the array
Sentry construction and use
Stack (linear structure)
Functions of tensorrt
Sublime text configuring PHP compilation environment
Linux MySQL 5.6.51 community generic installation tutorial
MySQL index
unittest. Texttestrunner does not generate TXT test reports
selenium备忘录:selenium\webdriver\remote\remote_connection.py:374: ResourceWarning: unclosed<xxxx>解决办法
Eggjs -typeorm treeenity practice
20201025 Visual Studio2019 QT5.14 信号和槽功能的使用
CTF three count
Asynchronous data copy in CUDA
web自动化切换窗口时报错“list“ object is not callable