webveuje/teaching/jwl/课件/js/dingshiqi.html
2021-04-09 16:36:34 +08:00

43 lines
1.4 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
// 定时器 setinterval(多长时间后自动执行) settimeout延迟多久执行
// var time= setInterval(() => {
// var now= new Date()
// console.log(now)
// console.log(now.getFullYear()+'/'+parseInt(now.getMonth()+1)+'/'+now.getDate())
// // getmonth() 取到的值是当前月份的前一天
// // getday 周几
// console.log(now.getHours()+':'+now.getMinutes()+':'+now.getSeconds())
// }, 1000);
// function stop(){
// clearInterval(time)
// }
// function yanchi(){
// var yc=setTimeout(function(){
// alert("hello world")
// },3000)
// // clearTimeout(yc)
// }
// 日期时间
// var now= new Date()
// console.log(now)
// console.log(now.getFullYear()+'/'+parseInt(now.getMonth()+1)+'/'+now.getDate())
// // getmonth() 取到的值是当前月份的前一天
// // getday 周几
// console.log(now.getHours()+':'+now.getMinutes()+':'+now.getSeconds())
</script>
</head>
<body>
<button onclick="stop()">stop</button>
<button onclick="yanchi()">yanchi</button>
</body>
</html>