Write a JavaScript code block using arrays and generate the current date in words, this should include the day, month and year.

<html>
<head>
<script type = "text/javascript">
    var d = new Date();
    var weekday = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    var monthname = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
    document.write(weekday[d.getDay()] + " ");
    document.write(d.getDate() + ". ");
    document.write(monthname[d.getMonth()] + " ");
    document.write(d.getFullYear());;
</script>
</head>
<body>
   
</body>
</html>

3 comments:


  1. Thanks, Learned a lot of new things from your post! Good creation and HATS OFF to the creativity of your mind.
    Very interesting and useful blog!
    javascript Training in Gurgaon


    ReplyDelete
  2. It is amazing and wonderful to visit your site. Thanks for sharing information; this is useful to us...

    Mean Stack Training in Delhi

    ReplyDelete