JavaScriptda kun oxiri

Keling, joriy kun oxirini o‘z ichiga olgan sana ob'ektini olamiz:

javascriptlet now  = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59);

Joriy kun oxiri keyingi kunning yarim kechasi deb hisoblash mumkin (1 soniya farq bilan):

javascriptlet now  = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 0, 0, 0);

Ma'lumki, bunday hollarda nollarni tushirib qoldirish mumkin:

javascriptlet now  = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);

Aytgancha, 24:00:00 joriy kunning yarim kechasi hisoblanadi:

javascriptlet now  = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 24, 0, 0);

Nollarni tushiramiz:

javascriptlet now  = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 24);
Задание 1

Kun oxirigacha necha soat qolganligini aniqlang.