DayAndTime --- Computer Science --- Haas

Write a JavaScript program to print out the current day and time.

Example 1:
Computer >> It's Monday 9 am. Good Morning!

Example 2:
Computer >> It's Saturday 7 pm. Good Evening!

The following code will give you the day and time as numeric values. Look at the program DateObject under Related Links for more help.

var date=new Date(); // Creates a new Date object
var day,hour;
day = date.getDay(); // number of days into the week: (0-6)
hour = date.getHours(); // number of hours into the day: (0-23)

Your program will need to figure out how to write the name of the day given a number (0 to 6), and the hour including am or pm given a number (0 to 23).
Your program also needs to write: Good morning, Good afternoon, or Good evening, based on the time.