﻿window.setInterval(
	function(){
		var mil = new Date()
		var minutes = mil.getMinutes() 
		var hours = mil.getHours()
		var seconds = mil.getSeconds()
		var miltime = ""
		miltime += hours
		miltime += ((minutes < 10) ? ":0" : ":") + minutes
		miltime += ((seconds < 10) ? ":0" : ":") + seconds
		miltime += (hours >= 12) ? " " : " "
		document.getElementById('thistime').innerHTML=miltime;
	}, 50
);
function longMonthArray() {
	this[0] = "Января";
	this[1] = "Февраля";
	this[2] = "Марта";
	this[3] = "Апреля";
	this[4] = "Мая";
	this[5] = "Июня";
	this[6] = "Июля";
	this[7] = "Августа";
	this[8] = "Сентября";
	this[9] = "Октября";
	this[10] = "Ноября";
	this[11] = "Декабря";
  return (this);
}
function getLongYear(year)
{
  if (year > 1900) return year
  return year+1900;
}
window.setInterval(
function ()
{
   longMonths = new longMonthArray();
   d = new Date();
   day = d.getDate();
   month = d.getMonth();
	 year = d.getYear();
   str = day + " " + longMonths[month] + " "+getLongYear(year);
   document.getElementById('thisdate').innerHTML=str;
  }, 50
);
/*function writeDate()
{
   writeDateLong(0);
}*/
