JavaScript : - Date Function
Hello Friends..!!
This is JavaScript Practical: - Date Function.
Script written in small letter because JavaScript Case
Sensitive.
Script:-
<html>
<head>
<title>Date function</title>
</head>
<body>
<script type="text/javascript">
var myDate = new Date();
document.write(myDate.toLocaleDateString());
document.write("<br />");
document.write(myDate.toLocaleString());
document.write("<br />");
document.write(myDate.toGMTString());
document.write("<br />");
document.write(myDate.toLocaleTimeString());
document.write("<br />");
document.write(myDate.toString());
document.write("<br />");
document.write(myDate.toISOString());
document.write("<br />");
document.write(myDate.toDateString());
document.write("<br />");
document.write(myDate.toUTCString());
document.write("<br />");
document.write(myDate.toTimeString());
</script>
</body>
</html>
Save the File .html
Output:-
If you have any
doubts mention on the Comment Box.
Please follow my Blog, Share and Comment.
Comments
Post a Comment