<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Get Current Datetime in JQuery</title>
<script type="text/javascript" language="javascript">
function GetDateTime()
{
var param1 = new Date();
var param2 = param1.getDate() + '/' + param1.getMonth() + '/' + param1.getFullYear() + ' ' + param1.getHours() + ':' + param1.getMinutes() + ':' + param1.getSeconds();
document.getElementById('lbltxt').innerHTML = param2;
}
</script>
</head>
<body onload="GetDateTime()">
<form id="form1" runat="server">
<div>
<label id="lbltxt"/>
</div>
</form>
</body>
</html>
DEMO
2/8/2013 15:52:36
<head>
<title>Get Current Datetime in JQuery</title>
<script type="text/javascript" language="javascript">
function GetDateTime()
{
var param1 = new Date();
var param2 = param1.getDate() + '/' + param1.getMonth() + '/' + param1.getFullYear() + ' ' + param1.getHours() + ':' + param1.getMinutes() + ':' + param1.getSeconds();
document.getElementById('lbltxt').innerHTML = param2;
}
</script>
</head>
<body onload="GetDateTime()">
<form id="form1" runat="server">
<div>
<label id="lbltxt"/>
</div>
</form>
</body>
</html>
DEMO
2/8/2013 15:52:36
No comments:
Post a Comment