An available pre-made object available to users in JavaScript is the Date object. This object can be used to retrieve the current date and time or to set the date & time. This object is handy for viewing the date & time on your website, or for doing comparisons between multiple times or dates. Utilize this object by creating a new Date object.
<script type= “text/javascript”>
var makeDate= new Date(); /* Declares a new Date object with default settings. The default
function show()
{
var win=window.open("","details");
format is displayed as Day Month Date HH:MM:SS Time Zone Year*/
win.document.write("The Date Getters");
win.document.write("<br />");
win.document.write("Date=" + makeDate.Date());
win.document.write("<br />");
win.document.write("Day=" + makeDate.getDay());
win.document.write("<br />");
win.document.write("Month=" + makeDate.getMonth());
win.document.write("The Time Getters");
win.document.write("<br />");
win.document.write("Hour=" + makeDate.getHour(););
win.document.write("<br />");
win.document.write("Minutes=" + makeDate.getMinutes());
win.document.write("<br />");
win.document.write("Seconds=" + makeDate.getSeconds());
win.document.write("<br />");
}
// --></script>
<input onclick="show()" type="button" value="Show date/time details" /></p>
51cbf0fd-1627-4195-9a94-2c4c36007b88|0|.0