var data = new Date();
alert(format(data));
alert(showTime(data));

var data2 = new Date(1989, 11, 8);
data2.setFullYear(2042);

alert(roznica(data, data2));

function roznica(data1, data2){
	return data1.getMilliseconds() - data2.getMilliseconds();
}

function showTime(data){
	return data.getHours()+":"+data.getMinutes()+":"+data.getSeconds();
}

function format(data){
	return data.getDate()+"."+(data.getMonth()+1)+"."+data.getFullYear();
}