Assignment012a

JavaScript - Date() - The Day

JavaScript comes prebuilt with several objects for you to use.
One of the objects is the Date() object. You can use the Date() object
to display the user's computer day and time. Here's how you go about it:

<script>

var todaysDate = new Date();

//get the day
var day = todaysDate.getDate();

// Get the month (returns 0 to 11)
var month = currentDate.getMonth();

// Adjust month
month = month + 1;

// Get the year (in four digits)
var year = currentDate.getFullYear();

</script>