Like this?
Code:
var date = new Date()
var fullDate = date.toLocaleDateString();
var hours = date.getHours()
var minutes = date.getMinutes()
if (minutes<10)
var time = hours + ":0"+minutes
else
var time = hours + ":" + minutes
document.getElementById('date_put').value=fullDate+" "+time
document.getElementById('date_put').size=document.getElementById('date_put').value.length+5
Remember to put a function inside it. eg:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Date and Time</title>
</head>
<body>
<script type="text/javascript">
window.onload=function(){
var date = new Date()
var fullDate = date.toLocaleDateString();
var hours = date.getHours()
var minutes = date.getMinutes()
if (minutes<10)
var time = hours + ":0"+minutes
else
var time = hours + ":" + minutes
document.getElementById('date_put').value=fullDate+" "+time
document.getElementById('date_put').size=document.getElementById('date_put').value.length+5
}
</script>
<input type="text" id="date_put">
</body>
</html>

Originally Posted by
winpeace
2-And another problem when the explorer refresh the coming date and coming time;the date and the time is change too.So how the date(and the time) is stop changing coming times and coming date
Well, obviously time changes doesn't it?
Bookmarks