💻พัฒนาเว็บเพจ ตอนที่ 24 - HTML5 & JS Find Difference Value Day/Hour

💻พัฒนาเว็บเพจ ตอนที่ 24 - HTML5 & JS Find Difference Value Day/Hour

Channel:
Subscribers:
336
Published on ● Video Link: https://www.youtube.com/watch?v=7tJevoyakqU



Duration: 17:40
8 views
0


#Zentref #IkaPayabaht #html5 #css #javascript
คำสั่งที่ใช้หาผลต่างวันเวลากี่วันกี่ชั่วโมงในคลิปนี้
function aa(){
//เรียกใช้งานตัว input ประเภท date อ้างอิงจาก id ของ input
var a = document.getElementById("num1").value;
var b = document.getElementById("num2").value;
// สร้าง object date
var s = new Date(a);
var t = new Date(b);
// สูตรคำนวณหาจำนวนกี่วัน
var u = (t.getTime()-s.getTime())/1000;
var v = Math.floor(u/86400);
// แสดงค่าใน input id ชื่อ num3
document.getElementById('num3').value = v;
}

function CheckTime(){
//เรียกใช้งานตัว input ประเภท datetime อ้างอิงจาก id ของ input
datetime1 = document.getElementById('text1').value;
datetime2 = document.getElementById('text2').value;
// สร้าง object date
var startDate = new Date(datetime1);
var endDate = new Date(datetime2);
// สูตรคำนวณหาจำนวนกี่ชม.
var seconds = (endDate.getTime() - startDate.getTime()) / 1000;
var days = Math.floor(seconds / (3600*24));
var hrs_d = Math.floor((seconds - (days * (3600*24))) / 3600);
var hrs = Math.floor(seconds / 3600);
// แสดงค่าใน input id ชื่อ total
document.getElementById('total').value = hrs_d;
}




Other Videos By Ikapayabaht


2021-11-30GTA Vice City Definitive Edition [FULL HD] Gameplay Part 7: บุกเข้าสนามกอล์ฟฆ่านักธุรกิจ
2021-11-30GTA Vice City Definitive Edition [FULL HD] Gameplay Part 8: หลบหนีตำรวจตามล่าคนส่งของ
2021-11-30GTA Vice City Definitive Edition [FULL HD] Gameplay Part 6: มนุษย์เลื่อยไฟฟ้าบุกฆ่าเจ้าพ่อ
2021-11-29GTA Vice City Definitive Edition [FULL HD] Gameplay Part 3: สั่งสอนและข่มขู่ทนายทั้งสอง
2021-11-29GTA Vice City Definitive Edition [FULL HD] Gameplay Part 5: ขับรถไล่ล่าสังหารเด็กส่งพิซซ่า
2021-11-29GTA Vice City Definitive Edition [FULL HD] Gameplay Part 4: ปลุกระดมม็อบคนงานประท้วง
2021-11-29👨‍💻สร้าง Web Application PHP Laravel ตอนที่ 17 การเข้ารหัส/ถอดรหัสข้อมูล
2021-11-29👨‍💻สร้าง Web Application PHP Laravel ตอนที่ 16 แสดงข้อมูลจำกัดตัวอักษร
2021-11-29💻พัฒนาเว็บเพจ ตอนที่ 26 - JS Random Number (Type Person Id)
2021-11-29💻พัฒนาเว็บเพจ ตอนที่ 25 - JS Format Phone Number Auto
2021-11-29💻พัฒนาเว็บเพจ ตอนที่ 24 - HTML5 & JS Find Difference Value Day/Hour
2021-11-27LEGO 🦖Jurassic World (2015) - Gameplay Walkthrough Part 20: Main Street Showdown
2021-11-27GTA Vice City Definitive Edition [FULL HD] Gameplay Part 2: คุ้มกันเพื่อนโดนพ่อครัวหมายหัว
2021-11-27GTA Vice City Definitive Edition [FULL HD] Gameplay Part 1: เชิญไปงานปาร์ตี้บนเรือสําราญ
2021-11-25🔆ต้อนรับน้องใหม่ CookieRun | 🧑‍🎄คุกกี้รสเอ๊กน็อก⚡Eggnog Cookie🍪
2021-11-23LEGO 🦖Jurassic World (2015) - Gameplay Walkthrough Part 19: Under Attack
2021-11-23LEGO 🦖Jurassic World (2015) - Gameplay Walkthrough Part 18: Out of Bounds13
2021-11-23LEGO 🦖Jurassic World (2015) - Gameplay Walkthrough Part 17: Gyrosphere Valley
2021-11-22LEGO 🦖Jurassic World (2015) - Gameplay Walkthrough Part 16: Welcome to Jurassic World
2021-11-22LEGO 🦖Jurassic World (2015) - Gameplay Walkthrough Part 14: Eric Kirby
2021-11-22LEGO 🦖Jurassic World (2015) - Gameplay Walkthrough Part 15: The Bird Cage



Tags:
Zentref
web
HTML
website
ภาษา html
css
CSS
html&css
javascript