SetMinutes () usuli
setMinutes()Usuli sana ob'ektini (0-59) ning daqiqa sozlash:
Misol
O'zingiz sinab ko'ring »
SetSeconds () usuli
setSeconds()Usuli sana ob'ektini (0-59) ning sekund sozlash:
Misol
O'zingiz sinab ko'ring »
Sanalarni solishtiring
Sanalarni osongina taqqoslash mumkin.
Quyidagi misol bugungi sanani 2100 yil 14-yanvar bilan taqqoslaydi:
Misol
var today, someday, text;
today = new Date();
someday = new Date();
someday.setFullYear(2100, 0, 14);
if (someday > today) {
text = "Today is before January 14, 2100.";
} else {
text = "Today is after January 14, 2100.";
}
document.getElementById("demo").innerHTML = text;
O'zingiz sinab ko'ring »
Javascript oylarni 0 dan 11 gacha sanaydi. Yanvar - 0. Dekabr - 11.
Do'stlaringiz bilan baham: |