มณฑล พร้อมสันเทียะ
for New Google Site
เลือก แทรก
<> ฝัง
เลือก ฝังโค้ด
คัดลอก script ไปวาง
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Prompt:wght@100&display=swap" rel="stylesheet">
<style>
body{
font-family: 'Prompt', sans-serif;
color: orange;
}
</style>
<center>
<h2 id="demo"></h2>
<script>
// Set the date we're counting down to //ตั้งค่า เดือน วัน ปี เวลา สิ้นสุดการนับ
var countDownDate = new Date("June 25, 2021 16:30:00").getTime();
// Update the count down every 1 second
var x = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
// Find the distance between now and the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Output the result in an element with id="demo" *** ข้อความที่ต้องการให้แสดงหน้าเว็บไซต์ ***
document.getElementById("demo").innerHTML = days + " วัน " + hours + " ชั่วโมง "
+ minutes + " นาที " + seconds + " วินาที ";
// If the count down is over, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById("demo").innerHTML = "EXPIRED : 0 วัน 0 นาที 0 วินาที"; //แสดงข้อความหลังสิ้นสุดเวลาที่กำหนด
}
}, 1000);
</script>
</center>