date_time.html
Dosyayı İndir
<html>
<head>
<script language="javascript">
var turkMonth=new Array("Ocak","Subat","Mart","Nisan","Mayis","Haziran","Temmuz","Agustos","Eylul","Ekim","Kasim","Aralik");
var turkDays=new Array("Pazar","Pazartesi","Sali","Carsamba","Persembe","Cuma","Cumartesi");
function setDate(){
var now=new Date();
var year=now.getFullYear();
var month=now.getMonth();
var day=now.getDate();
var dayOfWeek=now.getDay();
document.dateForm.dateText.value=day+" "+turkMonth[month]+" "+year; document.dateForm.dayText.value=turkDays[dayOfWeek];
setTheHours();
}
function setTheHours(){
var now=new Date();
var hour=now.getHours();
var minute=now.getMinutes();
var second=now.getSeconds();
var h=getZeroNumber(hour);
var m=getZeroNumber(minute);
var s=getZeroNumber(second);
document.dateForm.hourText.value=h+":"+m+":"+s;
window.setTimeout("setTheHours()",1000);
}
function getZeroNumber(number){
if(number<10){
return "0"+number.toString();
}else{
return number.toString();
}
}
</script>
<style>
input{
color:black;
background:white;
border-style:solid;
border-width:2px;
border-color:blue;
font-size:9pt;
font-weight:bold;
}
</style>
</head>
<body onLoad="setDate()">
<center>
<form name="dateForm">
<input type="text" value="" size="15" name="dateText" readonly></input><br>
<input type="text" value="" size="15" name="dayText" readonly></input><br>
<input type="text" value="" size="15" name="hourText" readonly></input>
</form>
</center>
</body>
</html>
Dosyayı İndir