Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
jooorooo каза:да кодима място с добавяне на 1900 години, но не се прави проверка.
<script type="text/javascript">function clock() {
now = new Date();
hours = now.getHours();
minutes = now.getMinutes();
seconds = now.getSeconds();
now_time = "" + hours;
now_time += ((minutes < 10) ? ":0" : ":") + minutes;
now_time += ((seconds < 10) ? ":0" : ":") + seconds;
date = now.getDate();
month = now.getMonth();
switch (month) {
case 0:
month = "Януари";
break;
case 1:
month = "Февруари";
break;
case 2:
month = "Март";
break;
case 3:
month = "Април";
break;
case 4:
month = "Май";
break;
case 5:
month = "Юни";
break;
case 6:
month = "Юли";
break;
case 7:
month = "Август";
break;
case 8:
month = "Септември";
break;
case 9:
month = "Октомври";
break;
case 10:
month = "Ноември";
break;
case 11:
month = "Декември";
break;
}
year = now.getYear();
den = now.getDay();
switch (den) {
case 0:
den = "Неделя";
break;
case 1:
den = "Понеделник";
break;
case 2:
den = "Вторник";
break;
case 3:
den = "Сряда";
break;
case 4:
den = "Четвъртък";
break;
case 5:
den = "Петък";
break;
case 6:
den = "Събота";
break;
}
year = now.getYear()+1900 ;
now_date = + date + " " + month + " " + year;
document.getElementById("clock_show").innerHTML = "<font face=Verdana size=2>" + now_date + ", " + now_time + "</font>";
setTimeout("clock()", 1000);
}
</script>
raiden каза:
<script type="text/javascript">function clock() {
year = now.getYear();
if(year < 2000) {
year = year +1900; }
now_date = + date + " " + month + " " + year;
document.getElementById("clock_show").innerHTML = "<font face=Verdana size=2>" + now_date + ", " + now_time + "</font>";
setTimeout("clock()", 1000);
}