Wednesday, February 22, 2012

Print date using JavaScript and PHP


This program is for print current system data. In java script, Date is in built object and you can access some property using inbuilt function.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
function date()
{
 var d=new Date();
 var day=d.getDay();
 var m=d.getMonth();
 var y=d.getFullYear();
 var date=d.getDate();
 alert(day+"/"+m+"/"+y);
}

</script>
</head>

<body>
<form name="myform" method="post" onSubmit="abc()">
<input type="button" onClick="date()"
</form>
</body>
</html>

No comments:

Post a Comment