JavaScriptda kun oxiri
Keling, joriy kun oxirini o‘z ichiga olgan sana ob'ektini olamiz:
let 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):
let 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:
let now = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);
Aytgancha, 24:00:00 joriy kunning
yarim kechasi hisoblanadi:
let now = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 24, 0, 0);
Nollarni tushiramiz:
let now = new Date();
let date = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 24);
Kun oxirigacha necha soat qolganligini aniqlang.