JS setFullYear () toutcstring () getday () Example Tutorial
First look at the setFullYear () Example:
<body>
<script type= "Text/javascript" >
var d = new Date ();
D.setfullyear (1992,10,3);
document.write (d);
</script>
</body>
Results.
Thu Nov 2008 08:32:43 UTC
toUTCString () instance.
<body>
<script type= "Text/javascript" >
var d = new Date ();
document.write (D.toutcstring ());
</script>
</body>
Answer Thu, Nov 2008 08:36:36 UTC
Getday ()
Use Getday () and an array to write a business day, not just a number.
<body>
<script type= "Text/javascript"
var d=new Date ();
Var Weekday=new Array (7);
weekday[0]= "Sunday";
weekday[1]= "Monday";
weekday[2]= "Tuesday";
weekday[3]= "Wednesday";
weekday[4]= "Thursday";
weekday[5]= "Friday";
weekday[6]= "Saturday";
document.write ("Today's It is" + weekday[d.getday ());
</script>
</body>
result.
Today it is Thursday