<script type="text/javascript">
function displayTime()
{
var localTime = new Date();
var year= localTime.getYear();
var month= localTime.getMonth() +1;
var date = localTime.getDate();
var hours = localTime .getHours();
var minutes = localTime .getMinutes();
var seconds = localTime .getSeconds();
var div=document.getElementById("div1");
div.innerText=year+"-"+month+"-"+date+" "+hours+":"+minutes+":"+seconds;
}
script>
Monday, April 5, 2010
Get Client Date Time in Javascript
Labels:
Javascript
Related Posts : Javascript
1 comment:
how can I use this script, sorry I'm new in web development. Can u show me the complete code please!
Post a Comment