Ниже оставил готовый скрипт.
<div id="timer"></div> <script> window.onload = time(); function time() { timeend = new Date(); timeend = new Date(timeend.getYear() > 1900 ? (timeend.getYear() + 1) : (timeend.getYear() + 1901), 0, 1); today = new Date(); today = Math.floor((timeend-today) / 1000); timestr="Before the new " + (new Date().getYear() + 1901) + " year, there are: " + today + " seconds"; document.getElementById('timer').innerHTML = timestr; window.setTimeout("time()", 1000); } </script>
0 Комментарии