Date() Methods in Javascript
Date() Methods in Javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Test Page</title>
</head>
<body>
<script type="text/javascript">
var x = new Date();
// var a= x.getFullYear();
// var b= x.getMonth();
// var c= x.getDay();
// var d= x.getHours();
// var e= x.getMinutes();
// var f= x.getSeconds();
// var g= x.getMilliseconds();
// var h= x.toDateString();
x.setMonth(0);
x.setFullYear(2024);
x.setHours(21);
x.setMinutes(45);
x.setSeconds(50);
x.setMilliseconds(500);
console.log(x);
</script>
</body>
</html>
Comments
Post a Comment
I WOULD APPRECIATE IF YOU LEAVE A COMMENT OR YOUR FEEDBACK HERE !!!