JS Date Methods

 
<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    var now = new Date();
                
	/* ToDateString Method Example */
	document.write(now.toDateString() + "<br><br>");
	
	/* GetDate Method */
	document.write(now.getDate() + "<br><br>");
	
	/* GetFullYear Method */
	document.write(now.getFullYear() + "<br><br>");

	/* GetMonth Method */
	document.write(now.getMonth() + "<br><br>");

	/* GetDay Method */
	document.write(now.getDay() + "<br><br>");

	/* GetHours Method */
	document.write(now.getHours() + "<br><br>");

	/* GetMinutes Method */
	document.write(now.getMinutes() + "<br><br>");

	/* GetSeconds Method */
	document.write(now.getSeconds() + "<br><br>");

	/* GetMilliseconds Method */
	document.write(now.getMilliseconds() + "<br><br>");
	
	/*setDate Method */
	now.setDate(20);
  
	/*setFullYear Method */
	now.setFullYear(2020);

	/*setFullYear Method */
	now.setMonth(4);

	/*setHours Method */
	now.setHours(14);
	
	document.write(now.getDate() + "/" + now.getMonth() + "/" + now.getFullYear());
  </script>
</head>
<body>
</body>
</html>